/// <summary> /// To update log in IntegrationInstanceSection /// Added by Dharmraj on 18-8-2014, PL#684 /// </summary> /// <param name="IntegrationInstanceSectionId"></param> /// <param name="Status"></param> /// <param name="SyncEnd"></param> /// <param name="Description"></param> public static void UpdateIntegrationInstanceSection(int IntegrationInstanceSectionId, StatusResult Status, string Description) { using (MRPEntities db = new MRPEntities()) { IntegrationInstanceSection objIntegrationInstanceSection = db.IntegrationInstanceSections.FirstOrDefault(i => i.IntegrationInstanceSectionId == IntegrationInstanceSectionId); objIntegrationInstanceSection.Status = Status.ToString(); objIntegrationInstanceSection.Description = Description; objIntegrationInstanceSection.SyncEnd = DateTime.Now; db.Entry(objIntegrationInstanceSection).State = EntityState.Modified; db.SaveChanges(); } }
/// <summary> /// To insert log in IntegrationInstanceSection /// Added by Dharmraj on 18-8-2014, PL#684 /// </summary> /// <param name="IntegartionInstanceLogId">IntegartionInstanceLogId</param> /// <param name="IntegartionInstanceId">Integration Instance Id</param> /// <param name="SectionName">Name of section (Entity) for which sync starts</param> /// <param name="SyncStart">sync start timestamp</param> /// <param name="CreateBy">logged in user id</param> /// <returns>IntegrationInstanceSectionId</returns> public static int CreateIntegrationInstanceSection(int IntegartionInstanceLogId, int IntegartionInstanceId, string SectionName, DateTime SyncStart, int CreateBy) { using (MRPEntities db = new MRPEntities()) { IntegrationInstanceSection objIntegrationInstanceSection = new IntegrationInstanceSection(); objIntegrationInstanceSection.IntegrationInstanceLogId = IntegartionInstanceLogId; objIntegrationInstanceSection.IntegrationInstanceId = IntegartionInstanceId; objIntegrationInstanceSection.SectionName = SectionName; objIntegrationInstanceSection.SyncStart = SyncStart; objIntegrationInstanceSection.CreatedDate = DateTime.Now; objIntegrationInstanceSection.CreateBy = CreateBy; db.Entry(objIntegrationInstanceSection).State = EntityState.Added; int resulValue = db.SaveChanges(); if (resulValue > 0) { return(objIntegrationInstanceSection.IntegrationInstanceSectionId); } else { return(0); } } }