Exemplo n.º 1
0
        public void Add(HttpRequestBase req)
        {
            TimeTable u_TimeTab;
            List<TimeTable> list_u_TimeTab = new List<TimeTable>();
            for (int i = 0; i < 13; ++i)
            {
                u_TimeTab = new TimeTable()
                {
                    UserID = Convert.ToInt32(req.Cookies[GLB.id].Value),
                    Section = Convert.ToInt16(i + 1),
                    FirstDay = req.Form["row" + i + "cell0"] == "on" ? '1' : '0',
                    SecondDay = req.Form["row" + i + "cell1"] == "on" ? '1' : '0',
                    ThirdDay = req.Form["row" + i + "cell2"] == "on" ? '1' : '0',
                    FourthDay = req.Form["row" + i + "cell3"] == "on" ? '1' : '0',
                    FifthDay = req.Form["row" + i + "cell4"] == "on" ? '1' : '0',
                    SixthDay = req.Form["row" + i + "cell5"] == "on" ? '1' : '0',
                    SeventhDay = req.Form["row" + i + "cell6"] == "on" ? '1' : '0'
                };
                list_u_TimeTab.Add(u_TimeTab);
            }
            tmTabDal = new TimeTableDAL();

            tmTabDal.Add(list_u_TimeTab);
            tmTabDal.ReturnUnitToPool();
        }
Exemplo n.º 2
0
        public ResponseStatus IsHaveData(HttpRequestBase req)
        {
            int id = Convert.ToInt32(req.Cookies[GLB.id].Value);
            tmTabDal = new TimeTableDAL();

            if (tmTabDal.IsHaveData(id))
            {
                tmTabDal.ReturnUnitToPool();
                return ResponseStatus.HAVE_TIMETABLE;
            }
            else
            {
                tmTabDal.ReturnUnitToPool();
                return ResponseStatus.HAVE_NO_TIMETABLE;
            }
        }
Exemplo n.º 3
0
        private ResponseStatus GetDetails(int id, Container_TimeTables_UserBases container_list_t)
        {
            tmTabDal = new TimeTableDAL();

            tmTabDal.GetDetails(id);
            tmTabDal.ReturnUnitToPool();
            container_list_t.list_t = tmTabDal.list_t;

            if (container_list_t.list_t.Count > 0)
            {
                return ResponseStatus.SUCCESS;
            }
            else
            {
                tmTabDal.list_t = null;
                return ResponseStatus.HAVE_NO_TIMETABLE;
            }
        }
Exemplo n.º 4
0
        public void Select(HttpRequestBase req, Container_List_FreeTime container_list_free)
        {
            TmTab_ResearchCon tmTab_RC = new TmTab_ResearchCon();

            //1,2,3,4,5,6,7
            tmTab_RC.WeekStart = !string.IsNullOrEmpty(req.Form["weekStart"]) ?
                Convert.ToInt32(req.Form["weekStart"]) : 1;
            tmTab_RC.WeekEnd = !string.IsNullOrEmpty(req.Form["weekEnd"]) ?
                Convert.ToInt32(req.Form["weekEnd"]) : 7;

            //1,3,5,7,9,10,12
            tmTab_RC.SectionStart = !string.IsNullOrEmpty(req.Form["sectionStart"]) ?
                Convert.ToInt32(req.Form["sectionStart"]) : 1;
            tmTab_RC.SectionEnd = !string.IsNullOrEmpty(req.Form["sectionEnd"]) ?
                Convert.ToInt32(req.Form["sectionEnd"]) : 12;

            object value = null;
            value = req.Form["grdID"];
            UserStatus us = new UserStatus();
            us.Grd = new Grade()
            {
                ID = !string.IsNullOrEmpty(value.ToString()) ? Convert.ToInt32(value) : 0
            };
            value = req.Form["collageID"];
            us.Clg = new Collage()
            {
                ID = !string.IsNullOrEmpty(value.ToString()) ? Convert.ToInt32(value) : 0
            };
            value = req.Form["depID"];
            us.Dep = new Department()
            {
                ID = !string.IsNullOrEmpty(value.ToString()) ? Convert.ToInt32(value) : 0
            };

            tmTabDal = new TimeTableDAL();
            tmTabDal.Select(us, tmTab_RC);
            tmTabDal.ReturnUnitToPool();
            container_list_free.list_free = tmTabDal.list_free;
        }