public IActionResult Post([FromBody] ReminderModel reminderModel) { var result = _business.Insert(reminderModel); if (result) { return(Ok(new { Type = TypeMessage.Success, Message = Resource.ResourceManager.GetString("SuccessCreateMessage") })); } else { return(BadRequest(new { Type = TypeMessage.Error, Message = Resource.ResourceManager.GetString("ErrorGenericMessage") })); } }
public IActionResult Create(ReminderModel reminderModel) { if (ModelState.IsValid) { var result = _business.Insert(reminderModel); if (result) { return(RedirectToAction("", new { Type = TypeMessage.Success, Message = Resource.ResourceManager.GetString("SuccessCreateMessage") })); } else { return(RedirectToAction("Create", new { Type = TypeMessage.Error, Message = Resource.ResourceManager.GetString("ErrorGenericMessage") })); } } return(View(reminderModel)); }