Ejemplo n.º 1
0
        public void Update(UserDepartmentCollectionForStaff 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 User Detials</param>
        /// <returns></returns>
        public ActionResult UpdateUserDepartments(UserDepartmentCollectionForStaff data)
        {
            _userDepartmentRepository.Update(data);

            return(Json("Ok"));
        }