public bool Update(int SubscriberId, string UserName, AfterActionReport AARModel) { try { using (AfterActionReportRepository AARRepo = new AfterActionReportRepository()) { AARModel.LastModifiedOn = Common.GetLocalDateTime(MemCache.GetFromCache <string>("Timezone_" + SubscriberId)); AARModel.LastModifiedBy = UserName; AARRepo.Update <AfterActionReport>(AARModel); return(true); } } 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; } }