/// <summary>
        /// Update delegate task user.
        /// </summary>
        /// <param name="model">The information delegate task.</param>
        /// <returns></returns>
        public ResultViewModel UpdateDelegate(WorkflowDelegateViewModel model)
        {
            var result = new ResultViewModel();

            model.StartDate = UtilityService.ConvertToDateTime(model.StartDateString, ConstantValue.DateTimeFormat);
            model.EndDate   = UtilityService.ConvertToDateTime(model.EndDateString, ConstantValue.DateTimeFormat);
            using (TransactionScope scope = new TransactionScope())
            {
                var data = _mapper.Map <WorkflowDelegateViewModel, WorkflowDelegate>(model);
                _unitOfWork.GetRepository <WorkflowDelegate>().Update(data);
                _k2Service.SetOutofOffice(data.FromUser, data.ToUser, ConstantValue.K2SharingEdit, data.StartDate.Value, data.EndDate.Value);
                _unitOfWork.Complete(scope);
            }
            return(result);
        }
 public IActionResult Edit([FromBody] WorkflowDelegateViewModel model)
 {
     return(Ok(_workflowDelegate.UpdateDelegate(model)));
 }
 public IActionResult Save([FromBody] WorkflowDelegateViewModel model)
 {
     return(Ok(_workflowDelegate.SaveDelegate(model)));
 }