public PartialViewResult _Detail() { List <TB_SUBJECTS> subjects = new List <TB_SUBJECTS>(); List <TB_BOXES> boxes = new List <TB_BOXES>(); List <TB_USERS> teachers = new List <TB_USERS>(); List <V_BOX_SUBJECT> boxSubject = new List <V_BOX_SUBJECT>(); List <TB_ROOM_CLASS> room = new List <TB_ROOM_CLASS>(); int count = 0; try { room = RoomClass_Service.GetAll(); boxSubject = Subjects_Boxes_Service.GetAllBy("", 1, short.MaxValue, out count); subjects = Subjects_Service.GetAll(); boxes = Boxes_Service.GetAll(); teachers = User_Service.GetAllTeacher(); } catch (Exception e) { Console.WriteLine(e); throw; } ViewBag.BoxSubject = boxSubject; ViewBag.subjects = subjects; ViewBag.boxes = boxes; ViewBag.teachers = teachers; ViewBag.Room = room; return(PartialView()); }
public PartialViewResult _Detail() { var subjects = new List <TB_SUBJECTS>(); try { subjects = Subjects_Service.GetAll(); ViewBag.boxes = Boxes_Service.GetAll(); } catch (Exception e) { Console.WriteLine(e); throw; } return(PartialView(subjects)); }
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()); }
public ActionResult Class_Detail(int id) { List <TB_SUBJECTS> subjects = new List <TB_SUBJECTS>(); List <TB_BOXES> boxes = new List <TB_BOXES>(); List <TB_USERS> users = new List <TB_USERS>(); List <TB_USERS> teachers = new List <TB_USERS>(); List <TB_USERS> studies = new List <TB_USERS>(); List <TB_USERS> students = new List <TB_USERS>(); List <TB_REGISTERS> register = new List <TB_REGISTERS>(); var detail = new V_CLASS(); var classes = new TB_SCHEDULES(); var details = new List <V_CLASS>(); try { subjects = Subjects_Service.GetAll(); boxes = Boxes_Service.GetAll(); users = User_Service.GetUserRegister(id.ToString()); int count = 0; details = Classes_Service.GetClassBy("", "", "", "", "", "", 1, Int16.MaxValue, out count); register = Registers_Service.GetAll(); studies = User_Service.GetStudiesBySchedule(id.ToString(), 1, Int16.MaxValue, out count); foreach (var tmp in details) { if (id.Equals(tmp.ScheduleId)) { detail = tmp; } } foreach (var user in users) { if (user.UserType.Equals("TEACHER")) { teachers.Add(user); } } foreach (var user in users) { if (user.UserType.Equals("STUDIES")) { students.Add(user); } } classes = Schedules_Service.GetById(id); } catch (Exception e) { Console.WriteLine(e); throw; } List <TB_USERS> lst = new List <TB_USERS>(); foreach (var item in students) { if (studies.Where(x => x.UserId == item.UserId).ToList().Count == 0) { lst.Add(item); } } ViewBag.Register = register; ViewBag.subjects = subjects; ViewBag.boxes = boxes; ViewBag.teachers = teachers; ViewBag.detail = detail; ViewBag.studies = studies; ViewBag.students = lst; ViewBag.id = id; return(PartialView(classes)); }