public async Task <bool> Update(SLAEscalationFRT SLAEscalationFRT) { SLAEscalationFRTDAO SLAEscalationFRTDAO = DataContext.SLAEscalationFRT.Where(x => x.Id == SLAEscalationFRT.Id).FirstOrDefault(); if (SLAEscalationFRTDAO == null) { return(false); } SLAEscalationFRTDAO.Id = SLAEscalationFRT.Id; SLAEscalationFRTDAO.TicketIssueLevelId = SLAEscalationFRT.TicketIssueLevelId; SLAEscalationFRTDAO.IsNotification = SLAEscalationFRT.IsNotification; SLAEscalationFRTDAO.IsMail = SLAEscalationFRT.IsMail; SLAEscalationFRTDAO.IsSMS = SLAEscalationFRT.IsSMS; SLAEscalationFRTDAO.Time = SLAEscalationFRT.Time; SLAEscalationFRTDAO.TimeUnitId = SLAEscalationFRT.TimeUnitId; SLAEscalationFRTDAO.IsAssignedToUser = SLAEscalationFRT.IsAssignedToUser; SLAEscalationFRTDAO.IsAssignedToGroup = SLAEscalationFRT.IsAssignedToGroup; SLAEscalationFRTDAO.SmsTemplateId = SLAEscalationFRT.SmsTemplateId; SLAEscalationFRTDAO.MailTemplateId = SLAEscalationFRT.MailTemplateId; SLAEscalationFRTDAO.UpdatedAt = StaticParams.DateTimeNow; await DataContext.SaveChangesAsync(); await SaveReference(SLAEscalationFRT); return(true); }
public async Task <bool> BulkMerge(List <SLAEscalationFRT> SLAEscalationFRTs) { List <SLAEscalationFRTDAO> SLAEscalationFRTDAOs = new List <SLAEscalationFRTDAO>(); foreach (SLAEscalationFRT SLAEscalationFRT in SLAEscalationFRTs) { SLAEscalationFRTDAO SLAEscalationFRTDAO = new SLAEscalationFRTDAO(); SLAEscalationFRTDAO.Id = SLAEscalationFRT.Id; SLAEscalationFRTDAO.TicketIssueLevelId = SLAEscalationFRT.TicketIssueLevelId; SLAEscalationFRTDAO.IsNotification = SLAEscalationFRT.IsNotification; SLAEscalationFRTDAO.IsMail = SLAEscalationFRT.IsMail; SLAEscalationFRTDAO.IsSMS = SLAEscalationFRT.IsSMS; SLAEscalationFRTDAO.Time = SLAEscalationFRT.Time; SLAEscalationFRTDAO.TimeUnitId = SLAEscalationFRT.TimeUnitId; SLAEscalationFRTDAO.IsAssignedToUser = SLAEscalationFRT.IsAssignedToUser; SLAEscalationFRTDAO.IsAssignedToGroup = SLAEscalationFRT.IsAssignedToGroup; SLAEscalationFRTDAO.SmsTemplateId = SLAEscalationFRT.SmsTemplateId; SLAEscalationFRTDAO.MailTemplateId = SLAEscalationFRT.MailTemplateId; SLAEscalationFRTDAO.CreatedAt = StaticParams.DateTimeNow; SLAEscalationFRTDAO.UpdatedAt = StaticParams.DateTimeNow; SLAEscalationFRTDAOs.Add(SLAEscalationFRTDAO); } await DataContext.BulkMergeAsync(SLAEscalationFRTDAOs); return(true); }
public async Task <bool> Create(SLAEscalationFRT SLAEscalationFRT) { SLAEscalationFRTDAO SLAEscalationFRTDAO = new SLAEscalationFRTDAO(); SLAEscalationFRTDAO.Id = SLAEscalationFRT.Id; SLAEscalationFRTDAO.TicketIssueLevelId = SLAEscalationFRT.TicketIssueLevelId; SLAEscalationFRTDAO.IsNotification = SLAEscalationFRT.IsNotification; SLAEscalationFRTDAO.IsMail = SLAEscalationFRT.IsMail; SLAEscalationFRTDAO.IsSMS = SLAEscalationFRT.IsSMS; SLAEscalationFRTDAO.Time = SLAEscalationFRT.Time; SLAEscalationFRTDAO.TimeUnitId = SLAEscalationFRT.TimeUnitId; SLAEscalationFRTDAO.IsAssignedToUser = SLAEscalationFRT.IsAssignedToUser; SLAEscalationFRTDAO.IsAssignedToGroup = SLAEscalationFRT.IsAssignedToGroup; SLAEscalationFRTDAO.SmsTemplateId = SLAEscalationFRT.SmsTemplateId; SLAEscalationFRTDAO.MailTemplateId = SLAEscalationFRT.MailTemplateId; SLAEscalationFRTDAO.CreatedAt = StaticParams.DateTimeNow; SLAEscalationFRTDAO.UpdatedAt = StaticParams.DateTimeNow; DataContext.SLAEscalationFRT.Add(SLAEscalationFRTDAO); await DataContext.SaveChangesAsync(); SLAEscalationFRT.Id = SLAEscalationFRTDAO.Id; await SaveReference(SLAEscalationFRT); return(true); }