public ActionResult UpdateEmployee(UpdateEmployeeViewModel uevm)
        {
            var employee = db.Employees
                .Where(e => e.Id == uevm.EmployeeId)
                .Include(e => e.User)
                .FirstOrDefault();

            employee.JobTypeId = uevm.JobTypeId;
            employee.User.Birthdate = uevm.Birthdate;
            employee.User.FirstName = uevm.FirstName;
            employee.User.LastName = uevm.LastName;
            db.SaveChanges();

            return RedirectToAction("ManageEmployees", "Branch");
        }
        public ActionResult UpdateEmployee(int id)
        {
            List<SelectListItem> sli = new List<SelectListItem>();

            var employee = db.Employees
                .Where(e => e.Id == id)
                .Include(e => e.User)
                .FirstOrDefault();

            UpdateEmployeeViewModel uevm = new UpdateEmployeeViewModel()
            {
                EmployeeId = employee.Id,
                Birthdate = employee.User.Birthdate,
                FirstName = employee.User.FirstName,
                LastName = employee.User.LastName,
                JobTypeId = employee.JobTypeId
            };

            foreach (JobType jt in db.JobTypes
                .Where(jt => jt.AccessPrivilege != AccessPrivilege.Administrator &&
                        jt.AccessPrivilege != AccessPrivilege.Owner)
                .ToList())
            {
                sli.Add(new SelectListItem
                {
                    Text = jt.Name,
                    Value = jt.Id.ToString()
                });
            }

            uevm.JobTypes = sli;

            return View(uevm);
        }