Beispiel #1
0
        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);
        }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
 public SectionBAL()
 {
     compdal = new SectionDAL();
 }
Beispiel #4
0
        public SectionEntities GetSectionByID(int sectionID)
        {
            SectionDAL sectionDl = new SectionDAL();

            return(sectionDl.GetSectionByID(sectionID));
        }
Beispiel #5
0
        public List <SectionEntities> GetAllSectionPageWise(int pageIndex, ref int recordCount, int length)
        {
            SectionDAL sectionDl = new SectionDAL();

            return(sectionDl.GetAllSectionPageWise(pageIndex, ref recordCount, length));
        }
Beispiel #6
0
        public int Delete(int id)
        {
            SectionDAL sectionDl = new SectionDAL();

            return(sectionDl.Delete(id));
        }
Beispiel #7
0
        public List <GradeEntities> GetAllGradeForDrp()
        {
            SectionDAL sectionDal = new SectionDAL();

            return(sectionDal.GetAllGradeForDrp());
        }
Beispiel #8
0
        public int SaveOrUpdate(SectionEntities section)
        {
            SectionDAL sectionDl = new SectionDAL();

            return(sectionDl.SaveOrUpdate(section));
        }