public List <ACM.Model.DeploymentPeriod> DeploymentPeriodInformation(ACM.Model.DeploymentPeriod request) { List <ACM.Model.DeploymentPeriod> response = new List <ACM.Model.DeploymentPeriod>(); try { using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context()) { ctx.Configuration.ProxyCreationEnabled = false; if (request != null) { response = (from deploymentperiod in ctx.DeploymentPeriods select deploymentperiod).ToList(); } ctx.Configuration.ProxyCreationEnabled = true; } } catch (Exception ex) { Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "DeploymentPeriodInformation"); throw; } return(response); }
public ACM.Model.DeploymentPeriod DeploymentPeriodAdd(ACM.Model.DeploymentPeriod request) { ACM.Model.DeploymentPeriod response = new ACM.Model.DeploymentPeriod(); try { using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context()) { request.CreatedDate = DateTime.Now; ctx.DeploymentPeriods.Add(request); ctx.SaveChanges(); ctx.Configuration.ProxyCreationEnabled = false; // IQueryable<ACM.Model.Campaign> response1 = ctx.Campaigns.Last(); response = (from deploymentperiod in ctx.DeploymentPeriods orderby deploymentperiod.DeploymentPeriodId descending select deploymentperiod).First(); ctx.Configuration.ProxyCreationEnabled = true; } } catch (Exception ex) { Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "DeploymentPeriodAdd"); throw; } return(response); }
public ACM.Model.DeploymentPeriod DeploymentPeriodAdd(ACM.Model.DeploymentPeriod request) { ACM.Model.DeploymentPeriod response = new ACM.Model.DeploymentPeriod(); try { using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context()) { request.CreatedDate = DateTime.Now; ctx.DeploymentPeriods.Add(request); ctx.SaveChanges(); ctx.Configuration.ProxyCreationEnabled = false; // IQueryable<ACM.Model.Campaign> response1 = ctx.Campaigns.Last(); response = (from deploymentperiod in ctx.DeploymentPeriods orderby deploymentperiod.DeploymentPeriodId descending select deploymentperiod).First(); ctx.Configuration.ProxyCreationEnabled = true; } } catch (Exception ex) { Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "DeploymentPeriodAdd"); throw; } return response; }
public string DeploymentModification(ACM.Model.DeploymentPeriod request) { try { using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context()) { request.ModifiedDate = DateTime.Now; ctx.Entry(request).State = EntityState.Modified; ctx.SaveChanges(); } } catch (Exception ex) { Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "DeploymentModification"); throw; } return("Successfully updated"); }
public ACM.Model.DeploymentPeriod DeploymentPeriodInquiry(ACM.Model.DeploymentPeriod request) { ACM.Model.DeploymentPeriod response = new ACM.Model.DeploymentPeriod(); try { using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context()) { ctx.Configuration.LazyLoadingEnabled = true; ctx.Configuration.ProxyCreationEnabled = false; if (request != null) { response = ctx.DeploymentPeriods.Find(request.DeploymentPeriodId); } } } catch (Exception ex) { Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "DeploymentPeriodInquiry"); throw; } return(response); }
public ACM.Model.DeploymentPeriod DeploymentPeriodInquiry(ACM.Model.DeploymentPeriod request) { ACM.Model.DeploymentPeriod response = new ACM.Model.DeploymentPeriod(); try { using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context()) { ctx.Configuration.LazyLoadingEnabled = true; ctx.Configuration.ProxyCreationEnabled = false; if (request != null) { response = ctx.DeploymentPeriods.Find(request.DeploymentPeriodId); } } } catch (Exception ex) { Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "DeploymentPeriodInquiry"); throw; } return response; }