public dynamic Update(BranchOffice model) { try { if (!AuthenticationModel.IsAllowed("Edit", Core.Constants.Constant.MenuName.BranchOffice, Core.Constants.Constant.MenuGroupName.Setting)) { Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "You are Not Allowed to Edit record"); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } var data = _branchOfficeService.GetObjectById(model.Id); data.Code = model.Code; data.Name = model.Name; data.Address = model.Address; data.City = model.City; data.PostalCode = model.PostalCode; data.PhoneNumber = model.PhoneNumber; data.FaxNumber = model.FaxNumber; data.Email = model.Email; //data.Website = model.Website; data.CompanyInfoId = model.CompanyInfoId; model = _branchOfficeService.UpdateObject(data, _companyInfoService); } catch (Exception ex) { LOG.Error("Update Failed", ex); Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "Error " + ex); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } return(Json(new { model.Errors })); }