public HttpResponseMessage ClassName() { HttpResponseMessage message; try { SectionDAL dal = new SectionDAL(); var dynobj = new { result = dal.ClassName() }; message = Request.CreateResponse(HttpStatusCode.OK, dynobj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" }); } return(message); }
public static void SyncToCanvas() { logger.Info("SectionService/SyncToCanvas - Task 'Sync section' STARTED"); try { SyncronizationDAL.SyncToCanvas(); List <sp_get_uniCanvas_ws_secciones_Result> sectionToSyncList = SectionDAL.SectionsToSync(); foreach (sp_get_uniCanvas_ws_secciones_Result sectionToSync in sectionToSyncList) { try { SectionController sectionController = new SectionController(); Section section = new Section(); section.course_section = new SectionDTO(sectionToSync); SectionDTO newSection = (SectionDTO)sectionController.Create(section, section.course_section.sis_course_id); if (newSection != null) { SectionDAL.UpdateCanvasData((int)sectionToSync.IDAcademico, newSection, newSection.group_id); } logger.Info("SectionService/SyncToCanvas - Task 'Sync section' FINISHED"); } catch (Exception e) { logger.Error("SectionService/SyncToCanvas - Task 'Sync section' FINISHED WITH ERROR: \n " + " Message: " + e.Message + "\nInner Exception: " + e.InnerException); SectionDTO newSection = new SectionDTO() { error_message = e.Message }; SectionDAL.UpdateCanvasData((int)sectionToSync.IDAcademico, newSection, newSection.group_id); } } } catch (Exception e) { return; } }
public SectionBAL() { compdal = new SectionDAL(); }
public SectionEntities GetSectionByID(int sectionID) { SectionDAL sectionDl = new SectionDAL(); return(sectionDl.GetSectionByID(sectionID)); }
public List <SectionEntities> GetAllSectionPageWise(int pageIndex, ref int recordCount, int length) { SectionDAL sectionDl = new SectionDAL(); return(sectionDl.GetAllSectionPageWise(pageIndex, ref recordCount, length)); }
public int Delete(int id) { SectionDAL sectionDl = new SectionDAL(); return(sectionDl.Delete(id)); }
public List <GradeEntities> GetAllGradeForDrp() { SectionDAL sectionDal = new SectionDAL(); return(sectionDal.GetAllGradeForDrp()); }
public int SaveOrUpdate(SectionEntities section) { SectionDAL sectionDl = new SectionDAL(); return(sectionDl.SaveOrUpdate(section)); }