Esempio n. 1
0
        public void saveCollectionPoint(DepartmentViewModel department)
        {
            string userId = User.Identity.GetUserId();
            Staff  s1     = StaffDepartmentDAO.GetStaffByUserId(userId);

            if (s1 != null)
            {
                int cId = department.collectionPointId;
                CollectionPointDAO.UpdateCollectionPoint(s1.departmentId, cId);
            }
        }
        public ActionResult ChangeCollectionPoint(Department department, int chosenPoint, int?staffList, int?oldDR)
        {
            string     id    = User.Identity.GetUserId();
            var        staff = StaffDepartmentDAO.GetStaffByUserId(id);
            Department dep   = staff.Department;

            CollectionPointDAO.UpdateCollectionPoint(dep.departmentId, chosenPoint);

            if (User.IsInRole("DH") || User.IsInRole("Temp DH"))
            {
                if (staffList != null)
                {
                    StaffDepartmentDAO.changeDR(staff.staffId, (int)staffList);
                }
            }
            return(View("~/Views/Home/Index.cshtml"));
        }