public async Task EditAsync(ActivityCallModel model) { var call = await _repository.GetAsyncCall(model.Id); ActivitiesFactory.CreateCall(model, call, _userId); _repository.EditCall(call); await _unitOfWork.SaveChangesAsync(); }
public static void CreateCall(ActivityCallModel model, ActivityCall entity, string userId) { entity.CallSubject = model.CallSubject; entity.CallDescription = model.CallDescription; entity.CallPurpose = model.CallPurpose; entity.CallDate = model.CallDate; entity.CallTime = model.CallTime; entity.UserId = model.UserId; entity.DescriptionHtml = model.DescriptionHtml; entity.EntityId = model.EntityId; entity.EntityMasterId = model.EntityMasterId; }
public async Task <IActionResult> EditCall([FromBody] ActivityCallModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorList())); } try { await _manager.EditAsync(model); } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok()); }
//For Call public static ActivityCall CreateCall(ActivityCallModel model, string userId) { var call = new ActivityCall { CallSubject = model.CallSubject, CallDescription = model.CallDescription, CallPurpose = model.CallPurpose, CallDate = model.CallDate, CallTime = model.CallTime, UserId = model.UserId, DescriptionHtml = model.DescriptionHtml, EntityId = model.EntityId, EntityMasterId = model.EntityMasterId, CreatedBy = userId ?? "0", CreatedOn = Utility.GetDateTime() }; return(call); }
//For Call public async Task AddAsyncCall(ActivityCallModel model) { await _repository.AddCallAsync(ActivitiesFactory.CreateCall(model, _userId)); await _unitOfWork.SaveChangesAsync(); }