protected void btnClick_btnAddTypeID(object sender, EventArgs e) { productdata = new ProductData(); product = new Product(); product.TypeID = 0; product.TypeName = string.IsNullOrEmpty(txtAddType.Text.ToString()) ? string.Empty : Convert.ToString(txtAddType.Text); product.CategoryId = Convert.ToInt32(dpCategory.SelectedItem.Value); product.CreatedBy = GlobalInfo.Userid; if (dpIsActive.SelectedItem.Value == "1") { product.IsActive = true; } else if (dpIsActive.SelectedItem.Text == "2") { product.IsActive = false; } //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 = "Insert"; int Result = 0; Result = productdata.AddTypeInfo(product); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Product type Add Successfully"; ClearTextBox(); BindTypeInfo(); 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(); } }
public void DeleteTypebyID(int TypeID) { productdata = new ProductData(); product = new Product(); product.TypeID = Convert.ToInt32(TypeID); product.TypeName = 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"; int Result = 0; Result = productdata.AddTypeInfo(product); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Type Deleted Successfully"; ClearTextBox(); //BindRouteList(); 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(); } }