public AfterActionReportView GetById(int id) { try { using (AfterActionReportRepository AARRepo = new AfterActionReportRepository()) { AfterActionReportView AARViewModel = new AfterActionReportView(); { AARViewModel = AARRepo.Get <AfterActionReportView>(id); return(AARViewModel); } } } catch (Exception ex) { throw ex; } }
public AfterActionReportView Add(Subscriber SubsModel, string UserName, AfterActionReport AARModel) { try { using (AfterActionReportRepository aarRepo = new AfterActionReportRepository()) { AfterActionReportView aarView = new AfterActionReportView(); AARModel.AddressedTo = string.Join(",", AARModel.AddressedToArray); AARModel.ReportingDatetime = Common.GetLocalDateTime(MemCache.GetFromCache <string>("Timezone_" + SubsModel.SubscriberId)); AARModel.SubscriberId = SubsModel.SubscriberId; AARModel.CreatedOn = Common.GetLocalDateTime(MemCache.GetFromCache <string>("Timezone_" + SubsModel.SubscriberId)); AARModel.CreatedBy = UserName; int rowId = aarRepo.Insert(AARModel); return(aarView = GetById(rowId)); } } catch (Exception ex) { throw ex; } }