public IActionResult CreateUpdate(UnitRequest request) { bool response = false; if (request.Id > 0) { response = _proxy.UpdateUnit(request.Id, request); if (response) { return(Redirect("/unit/list")); } } else { response = _proxy.CreateUnit(request); if (response) { return(Redirect("/unit/list")); } } ViewBag.Message = (!response) ? "Bad Request" : string.Empty; return(View(request)); }