Ejemplo n.º 1
0
        public ActionResult View(long insuranceId, string insuranceContractNo)
        {
            InputApproveInsuranceContractModel input = new InputApproveInsuranceContractModel();

            input.insuranceContractNo = insuranceContractNo;
            input.insuranceId         = insuranceId;
            input.userId = RDAuthorize.UserId;
            var result = _insuranceContractService.getDetailInsurContract(input);
            InsuranceContractViewModel model = new InsuranceContractViewModel();

            if (result != null)
            {
                Library.TransferData(result, ref model);
                List <InsuranceContractCollateralViewModel> lsCollateral = new List <InsuranceContractCollateralViewModel>();
                if (result.collateralList != null && result.collateralList.Any())
                {
                    Library.TransferData(result.collateralList, ref lsCollateral);
                }
                model.collateralList = lsCollateral;
                List <InsuranceContractProductViewModel> productList = new List <InsuranceContractProductViewModel>();
                if (result.productList != null && result.productList.Any())
                {
                    Library.TransferData(result.productList, ref productList);
                }
                model.productList = productList;
                List <HDBH.Models.ViewModel.AttachmentViewModel> fileList = new List <AttachmentViewModel>();
                if (result.fileList != null && result.fileList.Any())
                {
                    Library.TransferData(result.fileList, ref fileList);
                }
                ViewBag.fileList = fileList;
                List <ScheduleListViewModel> lsSchedule = new List <ScheduleListViewModel>();
                if (result.scheduleList != null && result.scheduleList.Any())
                {
                    Library.TransferData(result.scheduleList, ref lsSchedule);
                }
                List <ScheduleItemViewModel> lsPaymentDetail = new List <ScheduleItemViewModel>();
                if (result.paymentDetailList != null && result.paymentDetailList.Any())
                {
                    Library.TransferData(result.paymentDetailList, ref lsPaymentDetail);
                }
                foreach (var schedule in lsSchedule)
                {
                    schedule.scheduleDate     = schedule.schedulePaymentDate;
                    schedule.scheduleQuanlity = int.Parse(schedule.scheduleId.ToString());
                    schedule.productList      = lsPaymentDetail.Where(x => x.scheduleId == schedule.scheduleId).ToList();
                }
                ViewBag.strScheDuleTable = RenderPartialViewToString("~/Areas/InsuranceContract/Views/Shared/_cheduleList.cshtml", lsSchedule);
            }



            ViewBag.TypeCode   = model.contractTypeCode;
            ViewBag.FormCode   = model.contractFormCode;
            ViewBag.ExceptCode = model.exceptTypeCode;
            model.viewMode     = ViewModeCons.VIEW;
            ViewBag.viewMode   = ViewModeCons.VIEW;
            return(View("Create", model));
        }
Ejemplo n.º 2
0
        public ActionResult Create(string pFormCode, string pTypeCode, string pTypeName, string pExceptCode, string pContractNo)
        {
            InsuranceContractViewModel model = new InsuranceContractViewModel();

            ViewBag.TypeCode   = pTypeCode;
            ViewBag.TypeName   = pTypeName;
            ViewBag.FormCode   = pFormCode;
            ViewBag.ExceptCode = pExceptCode;
            ViewBag.ContractNo = pContractNo;
            model.viewMode     = ViewModeCons.CREATE;
            return(View(model));
        }