public ActionResult EstimateEditPopup(int id) { if (!_permissionService.Authorize(StandardPermissionProvider.ManageCountries)) { return(AccessDeniedView()); } var sp = _EstimateService.GetEstimateByStateId(id); if (sp == null) { var model = new EstimateModel(); model.StateId = id; //default value return(View(model)); } else { var spp = new EstimateModel(); spp.LePhiTruocBa = sp.LePhiTruocBa; spp.PhiBHVC = sp.PhiBHVC; spp.BaoHiemTNDS = sp.BaoHiemTNDS; spp.BienSo = sp.BienSo; spp.PhiBHVC = sp.PhiBHVC; spp.StateId = sp.StateId; spp.PhiDuongBo = sp.PhiDuongBo; spp.PhiKiemDinh = sp.PhiKiemDinh; return(View(spp)); } }