Example #1
0
        protected void btnClick_btnAddBrandID(object sender, EventArgs e)
        {
            productdata          = new ProductData();
            product              = new Product();
            product.BrandID      = 0;
            product.BrandName    = string.IsNullOrEmpty(txtBrand.Text.ToString()) ? string.Empty : Convert.ToString(txtBrand.Text);
            product.TINNumber    = string.IsNullOrEmpty(txtTinNo.Text.ToString()) ? string.Empty : Convert.ToString(txtTinNo.Text);
            product.CreatedBy    = GlobalInfo.Userid;
            product.Createddate  = DateTime.Now.ToString("dd-MM-yyyy");
            product.ModifiedBy   = GlobalInfo.Userid;
            product.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy");
            product.flag         = "Insert";
            int Result = 0;

            Result = productdata.AddBrandInfo(product);



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

                ClearTextBox();
                GetBrandInfo();
                pnlError.Update();
                upMain.Update();
                uprouteList.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }
Example #2
0
        public void DeleteBrandbyID(int BrandID)
        {
            productdata          = new ProductData();
            product              = new Product();
            product.BrandID      = Convert.ToInt32(BrandID);
            product.BrandName    = string.Empty;
            product.TINNumber    = string.IsNullOrEmpty(txtTinNo.Text.ToString()) ? string.Empty : Convert.ToString(txtTinNo.Text);
            product.CreatedBy    = GlobalInfo.Userid;
            product.IsActive     = true;
            product.Createddate  = DateTime.Now.ToString("dd-MM-yyyy");
            product.ModifiedBy   = GlobalInfo.Userid;
            product.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy");
            product.flag         = "Delete";
            int Result = 0;

            Result = productdata.AddBrandInfo(product);
            if (Result > 0)
            {
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                lblSuccess.Text     = "Brand Deleted  Successfully";

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