using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class AssetCategory : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Btn_Insert_Click(object sender, EventArgs e)
    {
        UDF_SaveCategory();
    }

    private void UDF_SaveCategory()
    {
        Class_tblAssetCategory tblCtg = new Class_tblAssetCategory(Txt_AsseCategory.Text.Trim());
        if (tblCtg.UDF_CheckDuplicate() == 0)
        {
            tblCtg.UDF_SaveAssetCategory();
            Txt_AsseCategory.Text = String.Empty;
            Grd_AssetCategory.DataBind();
            Lbl_Error.Text = "رکورد جدید درج شد";
        }
        else
        {
            Lbl_Error.Text = "اشکالی در درج رکورد به وجود آمده است";
        }
    }
}
