Exemple #1
0
        public PartialViewResult _ReportSalary(string userId = "", string scheduleId = "", string startDate = "", string endDate = "", int pageNumber = 1, int pageSize = 10)
        {
            int count = 0;

            ViewBag.pageNumber = pageNumber;
            ViewBag.pageSize   = pageSize;
            ViewBag.maxNumber  = 0;
            List <V_SALARY_TEACHER> list           = new List <V_SALARY_TEACHER>();
            List <TB_SCHEDULES>     listSche       = new List <TB_SCHEDULES>();
            List <TB_SUBJECTS>      listSuject     = new List <TB_SUBJECTS>();
            List <TB_BOX_SUBJECTS>  listBoxSubject = new List <TB_BOX_SUBJECTS>();
            List <TB_TRANSACTION>   listTran       = new List <TB_TRANSACTION>();
            List <TB_USERS>         listUser       = new List <TB_USERS>();
            int total = 0;

            try
            {
                listUser       = User_Service.GetAllTeacher();
                listTran       = Transaction_Service.GetAllBy(userId, startDate, endDate, "TEACHER");
                listSuject     = Subjects_Service.GetAll();
                listBoxSubject = Subjects_Boxes_Service.GetAll();
                listSche       = Schedules_Service.GetAll();
                list           = User_Service.GetSalaryTeacher(userId, scheduleId, startDate, endDate, pageNumber, pageSize, out count);
                total          = count + listTran.Count;
            }
            catch (Exception e)
            {
                ViewBag.Error = e.ToString();
            }
            ViewBag.maxNumber   = Math.Ceiling((double)total / pageSize);
            ViewBag.Salary      = list;
            ViewBag.Subject     = listSuject;
            ViewBag.SubjectBox  = listBoxSubject;
            ViewBag.Schedule    = listSche;
            ViewBag.Transaction = listTran;
            ViewBag.User        = listUser;
            return(PartialView());
        }