예제 #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            category              = new Category();
            purchaseData          = new PurchaseData();
            category.CategoryId   = string.IsNullOrEmpty(hfBrandId.Value) ? 0 : Convert.ToInt32(hfBrandId.Value);
            category.CategoryName = string.IsNullOrEmpty(txtCategoryName.Text.ToString()) ? string.Empty : Convert.ToString(txtCategoryName.Text);
            category.Description  = string.IsNullOrEmpty(txtDesciption.Text.ToString()) ? string.Empty : Convert.ToString(txtDesciption.Text);
            if (dpIsActive.SelectedItem.Value == "1")
            {
                category.IsActive = true;
            }
            else
            {
                category.IsActive = false;
            }

            category.Flag = 3; //3 for update

            int Result = 0;

            Result = purchaseData.CategoryDML(category);



            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Category Updated  Successfully";

                ClearTextBox();
                GetList();
                pnlError.Update();

                uprouteList.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }