public JsonResult UpdateProfile(Organization newOrg) { try { if (newOrg != null) { CompanyProfile cp = new CompanyProfile(this.HttpContext); Organization org = OrganizationRepository.GetOrganization(cp.BranchId); newOrg.BranchId = org.BranchId; OrganizationService.Update(newOrg); return Json(new { error = false, data= newOrg }, JsonRequestBehavior.AllowGet); } return Json(new { error = true, message = "Gagal ubah profil perusahaan." }, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return Json(new { error = true, message = ex.Message }, JsonRequestBehavior.AllowGet); } }
public void Update(Organization org) { _reportingRepository.Update<Organization>(org, new { BranchId = org.BranchId }); }