Example #1
0
        protected void btnClick_btnAddSlabID(object sender, EventArgs e)
        {
            productdata          = new ProductData();
            product              = new Product();
            product.SlabID       = 0;
            product.SlabName     = string.IsNullOrEmpty(txtSlab.Text.ToString()) ? string.Empty : Convert.ToString(txtSlab.Text);
            product.SlabDisc     = string.IsNullOrEmpty(txtSlabDisc.Text.ToString()) ? string.Empty : Convert.ToString(txtSlabDisc.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");
            if (dpStatus.SelectedItem.Value == "1")
            {
                product.IsActive = false;
            }
            if (dpStatus.SelectedItem.Value == "2")
            {
                product.IsActive = true;
            }

            product.flag = "Insert";
            int Result = 0;

            Result = productdata.AddSlabInfo(product);



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

                ClearTextBox();
                GetSlabInfo();
                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 DeleteSlabbyID(int SlabID)
        {
            productdata          = new ProductData();
            product              = new Product();
            product.SlabID       = Convert.ToInt32(SlabID);
            product.SlabName     = string.Empty;
            product.SlabDisc     = string.Empty;
            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";
            if (dpStatus.SelectedItem.Value == "1")
            {
                product.IsActive = false;
            }
            if (dpStatus.SelectedItem.Value == "2")
            {
                product.IsActive = true;
            }
            int Result = 0;

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

                ClearTextBox();
                GetSlabInfo();
                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();
            }
        }