private int saveHeadFiv() { int j = 1; try { subheadcategoryfive subheadfive = new subheadcategoryfive(); foreach (GridViewRow g1 in GVPro.Rows) { if (HFSubHeadCatFivID.Value == "") { ShowAccountCategoryFiveID(); } string TBItmNam = (g1.FindControl("TBItmNam") as TextBox).Text; string DDL_Unt = (g1.FindControl("DDL_Unt") as DropDownList).SelectedValue; string DDL_Itmtyp = (g1.FindControl("DDL_Itmtyp") as DropDownList).SelectedValue; string TBpksiz = (g1.FindControl("TBpksiz") as TextBox).Text; string TBRtlPrc = (g1.FindControl("TBRtlPrc") as TextBox).Text; subheadfive.subheadcategoryfiveID = HFSubHeadCatFivID.Value; subheadfive.subheadcategoryfiveName = string.IsNullOrEmpty(TBItmNam) ? null : TBItmNam; subheadfive.subheadcategoryfiveGeneratedID = string.IsNullOrEmpty(SubHeadCatFiv.Value) ? null : SubHeadCatFiv.Value; subheadfive.HeadGeneratedID = string.IsNullOrEmpty("MB001") ? null : "MB001"; subheadfive.SubHeadGeneratedID = string.IsNullOrEmpty("MB0001") ? null : "MB0001"; subheadfive.SubHeadCategoriesGeneratedID = string.IsNullOrEmpty("MB00001") ? null : "MB00001"; subheadfive.subheadcategoryfourGeneratedID = string.IsNullOrEmpty("MB000002") ? null : "MB000002"; subheadfive.CreatedAt = DateTime.Now; subheadfive.CreatedBy = Session["user"].ToString(); subheadfive.SubFiveKey = string.IsNullOrEmpty(SubHeadCatFiv.Value) ? null : SubHeadCatFiv.Value; subheadcategoryfiveManager subheadcatfive = new subheadcategoryfiveManager(subheadfive); subheadcatfive.Save(); Products products = new Products(); products.ProductID = HFProID.Value; products.ProductTypeID = DDL_Itmtyp != "0" ? DDL_Itmtyp : null; products.ProductName = string.IsNullOrEmpty(TBItmNam) ? null : TBItmNam; products.PckSize = string.IsNullOrEmpty(TBpksiz) ? null : TBpksiz; products.Cost = string.IsNullOrEmpty(TBRtlPrc) ? null : TBRtlPrc; products.ProductDiscriptions = string.IsNullOrEmpty(TBItmNam) ? null : TBItmNam; products.Supplier_CUstomer = ""; //string.IsNullOrEmpty(TBSupCus.Value) ? null : TBSupCus.Value; products.Unit = string.IsNullOrEmpty(DDL_Unt) ? null : DDL_Unt; products.ProductType = DDL_Itmtyp != "0" ? DDL_Itmtyp : null; products.CreatedBy = Session["user"].ToString(); products.CreatedAt = DateTime.Now; products.Pro_Code = string.IsNullOrEmpty(SubHeadCatFiv.Value) ? null : SubHeadCatFiv.Value; ProductsManager promanag = new ProductsManager(products); promanag.Save(); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true); lblalert.Text = ex.Message; } return(j); }
public override bool Equals(object obj) { if (obj == null) { return(false); } subheadcategoryfive subheadcategoryfive = new subheadcategoryfive(); if (subheadcategoryfive == null) { return(false); } if (this.subheadcategoryfiveID == subheadcategoryfive.subheadcategoryfiveID) { return(true); } else { return(false); } }
public subheadcategoryfiveManager(subheadcategoryfive _subheadcategoryfive) { subheadcategoryfive = _subheadcategoryfive; }