public bool SaveSettlementDetails(List <SettlementDetails> settlementDetails) { bool isSaved = false; SettlementDetailsLibrary settlementDetailsLibrary = new SettlementDetailsLibrary(); settlementDetailsLibrary.Initialize(ConfigurationHelper.GetsmARTDBContextConnectionString()); foreach (SettlementDetails settlementDet in settlementDetails) { settlementDetailsLibrary.Add(settlementDet); isSaved = true; } return(isSaved); }
public bool SaveSettlementDetails(string[] childEntityList, Settlement settlement) { bool isSaved = false; foreach (string ChildEntity in childEntityList) { switch (ChildEntity) { #region /* Case Statements - All child grids */ case "SettlementDetails": if (Session[ChildEntity] != null) { SettlementDetailsLibrary settlementDetailsLibrary = new SettlementDetailsLibrary(); settlementDetailsLibrary.Initialize(ConfigurationHelper.GetsmARTDBContextConnectionString()); IEnumerable <SettlementDetails> resultList = (IList <SettlementDetails>)Session[ChildEntity]; resultList = resultList.Where(o => o.Scale_Details_ID.Scale.ID == settlement.Scale.ID); foreach (SettlementDetails settlementDetails in resultList) { settlementDetails.Settlement_ID = new Settlement { ID = settlement.ID }; //settlementDetails.Created_By = HttpContext.User.Identity.Name; //settlementDetails.Created_Date = DateTime.Now; //settlementDetails.Active_Ind = true; //settlementDetails.Updated_By = HttpContext.User.Identity.Name; //settlementDetails.Last_Updated_Date = DateTime.Now; settlementDetailsLibrary.Add(settlementDetails); isSaved = true; } } break; #endregion } } return(isSaved); }