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"));
        }
Beispiel #2
0
        public bool saveDepartmentRep(StaffViewModel newDR)
        {
            if (newDR == null)
            {
                return(false);
            }

            string userId = User.Identity.GetUserId();
            Staff  s1     = StaffDepartmentDAO.GetStaffByUserId(userId);

            if (s1 == null)
            {
                return(false);
            }

            bool bRes = StaffDepartmentDAO.changeDR(s1.staffId, newDR.staffId);

            return(bRes);
        }