Example #1
0
        public IActionResult Edit(Assignment updatedAssignment)
        {
            int clientId   = 0;
            int employeeId = 0;

            if (updatedAssignment.ClientId > 0 && updatedAssignment.EmployeeId > 0)
            {
                var assignment = _assignmentRepository.Update(updatedAssignment);
                _assignmentRepository.Commit();
                clientId   = assignment.ClientId;
                employeeId = assignment.EmployeeId;
            }
            else
            {
                var assignment = _assignmentRepository.Add(updatedAssignment);
                _assignmentRepository.Commit();
                clientId   = assignment.ClientId;
                employeeId = assignment.EmployeeId;
            }
            //TempData["Message"] = "Assignment data saved";
            return(RedirectToAction("List"));
        }