public static void CreateNotes(ActivityNoteModel model, ActivityNotes entity, string userId) { entity.NoteDescription = model.NoteDescription; entity.DescriptionHtml = model.DescriptionHtml; entity.EntityId = model.EntityId; entity.EntityMasterId = model.EntityMasterId; }
public async Task EditAsyncNotes(ActivityNoteModel model) { var notes = await _repository.GetAsyncNotes(model.Id); ActivitiesFactory.CreateNotes(model, notes, _userId); _repository.EditNotes(notes); await _unitOfWork.SaveChangesAsync(); }
//For Notes public static ActivityNotes CreateNotes(ActivityNoteModel model, string userId) { var call = new ActivityNotes { NoteDescription = model.NoteDescription, DescriptionHtml = model.DescriptionHtml, EntityId = model.EntityId, EntityMasterId = model.EntityMasterId, CreatedBy = userId ?? "0", CreatedOn = Utility.GetDateTime() }; return(call); }
public async Task <IActionResult> EditNotes([FromBody] ActivityNoteModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorList())); } try { await _manager.EditAsyncNotes(model); } catch (Exception ex) { return(BadRequest(ex.Message)); } return(Ok()); }
//For Notes public async Task AddAsyncNotes(ActivityNoteModel model) { await _repository.AddNoteAsync(ActivitiesFactory.CreateNotes(model, _userId)); await _unitOfWork.SaveChangesAsync(); }