public ActionResult Home()
        {
            //Testing Hardcode
            //int idEmployee = 4;
            int                    idEmployee       = (int)Session["IdEmployee"];
            Employee               employee         = _employeeDAO.FindEmployeeById(idEmployee);
            Disbursement           disbursement     = _disbursementDAO.GetScheduledDisbursement(employee.CodeDepartment);
            List <CollectionPoint> collectionPoints = _collectionPointDAO.FindAll();

            ViewBag.disbursement = disbursement;
            if (disbursement != null)
            {
                ViewBag.status       = disbursement.Status;
                ViewBag.department   = disbursement.Department;
                ViewBag.collectionPt = disbursement.CollectionPoint;
                //get the storeclerk from cpclerk
                ViewBag.storeClerk        = _collectionPointDAO.FindClerkByCollectionPointId(disbursement.CollectionPoint.IdCollectionPt);
                ViewBag.disbursementItems = disbursement.DisbursementItems;
            }
            else
            {
                ViewBag.disbursement      = new Disbursement();
                ViewBag.status            = new Status();
                ViewBag.department        = new Department();
                ViewBag.collectionPt      = new CollectionPoint();
                ViewBag.storeClerk        = new Employee();
                ViewBag.disbursementItems = new DisbursementItem();
            }
            ViewBag.allCollectionPoints = collectionPoints;
            ViewData["Rep"]             = employee;
            return(View());
        }
Ejemplo n.º 2
0
        // change Rep and CP
        public ActionResult ChangeRepCP()
        {
            // find employee from the department
            //String codeDepartment = "CPSC";
            string                 codeDepartment = _departmentDAO.FindCodeDepartmentByIdEmployee((int)Session["IdEmployee"]);
            List <Employee>        empList        = _employeeDAO.FindEmployeeListByDepartment(codeDepartment);
            List <CollectionPoint> cpList         = _collectionPointDAO.FindAll();

            //ViewBag.Employee = new SelectList(empList, "IdEmployee", "Name"); // put inside drop down list
            ViewBag.EmployeeList    = empList;
            ViewBag.CollectionPoint = cpList;

            // find current rep
            int      idHead = (int)Session["IdEmployee"];
            Employee oldRep = _employeeDAO.FindCurrentRepAndCPByHeadId(idHead);

            ViewBag.oldRep = oldRep;
            return(View());
        }