Beispiel #1
0
        public ActionResult StaffDetailReport(FormCollection formObject)
        {
            string   department, designation;
            DateTime startDate, fromDate;

            ViewBag.StaffDepartmentCode = new SelectList(db.Departments, "DepartmentCode", "DepartmentName");
            ViewBag.SemesterCode        = new SelectList(db.Semesters, "SemesterCode", "SemesterDesc");
            ViewBag.OfficeCode          = new SelectList(db.Locations, "RoomNo", "RoomNo");

            department  = formObject["StaffDepartmentCode"];
            startDate   = Convert.ToDateTime(formObject["StartDate"]);
            fromDate    = Convert.ToDateTime(formObject["FromDate"]);
            designation = formObject["staff.StaffDesignation"];

            var staffList = db.Staffs.Where(a => a.StaffDepartmentCode.Equals(department) && a.StaffDesignation.Equals(designation));
            // staffList = staffList.Where(a => a.StaffHireDate >= startDate && a.StaffHireDate <= fromDate); a.



            staffReportView reportView = new staffReportView()
            {
                staff  = new Staff(),
                staffs = staffList.ToList()
            };

            return(View(reportView));
        }
Beispiel #2
0
        public ActionResult StaffDetailReport()
        {
            ViewBag.StaffDepartmentCode = new SelectList(db.Departments, "DepartmentCode", "DepartmentName");
            ViewBag.SemesterCode        = new SelectList(db.Semesters, "SemesterCode", "SemesterDesc");
            ViewBag.OfficeCode          = new SelectList(db.Locations, "RoomNo", "RoomNo");

            var staffList = db.Staffs.Include(s => s.Department).Include(s => s.Semester);
            //ViewBag.Department = new SelectList(db.Departments, "DepartmentCode", "DepartmentName", dept.DepartmentName);

            staffReportView reportView = new staffReportView
            {
                staff  = new Staff(),
                staffs = staffList.ToList()
            };

            return(View(reportView));
        }