public JsonResult Create(OraganizationCreateVM oraganizationCreateVm) { bool isSaved = false; if (ModelState.IsValid) { var organization = oraganizationCreateVm; isSaved = organizationManager.Save(organization.Oraganization); } if (isSaved) { status = true; message = "Succesfully Saved"; } else { message = "Error! Please try again."; } return(new JsonResult { Data = new { status = status, message = message } }); }
// ********** TEST START *****************// public ActionResult Home() { var model = new OraganizationCreateVM(); model.Oraganization = new Organization(); return(View(model)); }
public JsonResult Search(OraganizationCreateVM oraganizationCreateVm) { var organization = oraganizationCreateVm; var organizations = organizationManager.GetOrganizationBySearchItem(organization.Oraganization); return(new JsonResult { Data = organizations, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult Edit(OraganizationCreateVM oraganizationCreateVm) { bool isUpdated = organizationManager.Update(oraganizationCreateVm.Oraganization); if (isUpdated) { status = true; message = "Update Successfully!!"; } return(new JsonResult { Data = new { status = status, message = message } }); }