예제 #1
0
        public void Update(UserDepartmentCollectionForDepartment data)
        {
            var updateCollection = data.ItemsToUpdate;
            var deleteCollection = data.ItemsToDelete;
            var insertCollection = data.ItemsToAdd;

            if (updateCollection != null)
            {
                Update(updateCollection);
            }
            if (deleteCollection != null)
            {
                Delete(deleteCollection);
            }
            if (insertCollection != null)
            {
                Insert(insertCollection);
            }
        }
 /// <summary>
 /// Method to update UserDepartments.
 /// </summary>
 /// <param name="data">Collection of UserDepartments to add/delete/update. It also contains Department Data</param>
 /// <returns></returns>
 public ActionResult UpdateUserDepartments(UserDepartmentCollectionForDepartment data)
 {
     _userDepartmentRepository.Update(data);
     return(Json("Ok"));
 }