public JsonResult AddOrUpdate(DOCUS_ASM_ASSIGNMENTS assignment)
        {
            JsonResult result = new JsonResult();

            if (ModelState.IsValid)
            {
                assignment.DATE_ENTERED = DateTime.Now;
                var notesTobeSaved = new AssignmentNotes();
                var notesResponse = true;
                if (!assignment.Notes.IsNullOrWhiteSpace())
                {
                    notesTobeSaved.ASSIGNMENT_ID = assignment.ASSIGNMENT_ID;
                    notesTobeSaved.NOTE = assignment.Notes;
                }
                //return _assignment.Create(assignment);
                switch (assignment.TransactionType)
                {
                    case "New Request":
                        var response = _assignment.Create(assignment);
                        if (!assignment.Notes.IsNullOrWhiteSpace())
                        {
                            notesTobeSaved.ASSIGNMENT_ID = response;
                            notesResponse = _notes.SaveNotes(notesTobeSaved);
                        }
                        result =
                              Json(
                                  new
                                  {
                                      data =
                                          response > 0 && notesResponse ? "Record Created Successuflly" : "Error Occurred",
                                      IsSuccess = result
                                  });
                        //RedirectToAction("Index", "Home",new{ id = assignment.ACCOUNT_NUMBER});
                        break;
                    default:
                        var update = _assignment.Update(assignment);
                        if (!assignment.Notes.IsNullOrWhiteSpace())
                            notesResponse = _notes.SaveNotes(notesTobeSaved);
                        result = Json(new { data = update && notesResponse ? "Record Updated Successuflly" : "Error Occurred", IsSuccess = result });
                        //RedirectToAction("Index", "Home", new { id = assignment.ACCOUNT_NUMBER });
                        break;
                }

            }
            else
            {
                var errors = ModelState.Where(x => x.Value.Errors.Count > 0);
                result = Json(new { data = errors, IsSuccess = false });
            }
            return result;
        }
 public bool SaveNotes(AssignmentNotes notes)
 {
     return apiInstance.Insert(notes, Constants.CREATENOTES);
 }
 public bool SaveNotes(AssignmentNotes notes)
 {
     return(apiInstance.Insert(notes, Constants.CREATENOTES));
 }