public bool CreateMasterPart(int pricebookId, MasterParts mpData) { try { mpData.ConceptID = 1; mpData.ActiveYN = true; using (var tScope = new TransactionScope()) { context.masterparts.Add(mpData); context.SaveChanges(); var part = new Parts() { PartAddonMemberPrice = 0, PartAddonStdPrice = 0, PartCost = mpData.PartCost, MasterPartID = mpData.MasterPartID, Markup = 0, PartMemberPrice = 0, PartStdPrice = 0, PriceBookID = pricebookId }; context.parts.Add(part); context.SaveChanges(); tScope.Complete(); } return(true); } catch { return(false); } }
public bool CreateMasterPart(MasterParts mpData) { var pricebookId = Convert.ToInt32(RouteData.Values["id"]); return(this.treeview.CreateMasterPart(pricebookId, mpData)); }