예제 #1
0
 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;
 }
예제 #2
0
        public async Task EditAsyncNotes(ActivityNoteModel model)
        {
            var notes = await _repository.GetAsyncNotes(model.Id);

            ActivitiesFactory.CreateNotes(model, notes, _userId);
            _repository.EditNotes(notes);
            await _unitOfWork.SaveChangesAsync();
        }
예제 #3
0
        //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);
        }
예제 #4
0
 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());
 }
예제 #5
0
        //For Notes
        public async Task AddAsyncNotes(ActivityNoteModel model)
        {
            await _repository.AddNoteAsync(ActivitiesFactory.CreateNotes(model, _userId));

            await _unitOfWork.SaveChangesAsync();
        }