private void SaveException(GCTSC_ExceptionLogging exception) { using (RiftEntities context = new RiftEntities()) { try { context.GCTSC_ExceptionLogging.Add(exception); context.SaveChanges(); } catch (Exception ex) { throw ex; } } }
public void UpdateContsuppVersionNumber(int newVersion) { using (RiftEntities context = new RiftEntities()) { SystemKey systemKey = (from sk in context.SystemKeys.Where(sk => sk.Key == Contsupp_LastVersion) select sk).FirstOrDefault(); if (systemKey != null) { systemKey.Value = newVersion.ToString(); context.Entry(systemKey).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } } }
private void SaveGeneralRequestInformation(ResponseDetails response, GCTSC_ChangeTracking ctRecord) { GCTSC_ChangeTracking_Requests request = new GCTSC_ChangeTracking_Requests() { ChangeTrackingId = ctRecord.Id, ResponseCode = response.SendResponse.ToString(), ResponseContent = response.ResponseContent, URL = response.URL }; using (RiftEntities context = new RiftEntities()) { try { context.GCTSC_ChangeTracking_Requests.Add(request); context.SaveChanges(); } catch (Exception ex) { throw ex; } } }
public void Log(ResultsObject resultObject) { GCTSC_ChangeTracking ctRecord = new GCTSC_ChangeTracking() { Accountno = resultObject.Accountno, Created = DateTime.Now }; using (RiftEntities context = new RiftEntities()) { try { context.GCTSC_ChangeTracking.Add(ctRecord); context.SaveChanges(); } catch (Exception ex) { throw ex; } } if (ctRecord.Id > 0 && resultObject.Responses.Count > 0) { SaveResponseInformation(ctRecord, resultObject.Responses); } }