Пример #1
0
        public ActionResult RefreshAddDocument(int id)
        {
            DocumentViewModel model = new DocumentViewModel();


            return(PartialView("_Document", model.GetDocuments(id)));
        }
Пример #2
0
        public ActionResult DeleteDocument(int id, int rid)
        {
            DocumentViewModel model = new DocumentViewModel();

            model.DeleteDocument(id);

            return(PartialView("_Document", model.GetDocuments(rid)));
        }
Пример #3
0
        // GET: Renewal
        public ActionResult Index(int id = 0)
        {
            int renewalId = 0;

            HttpContext.Server.ScriptTimeout = 60;

            if (id == 0)
            {
                id = BHIP.Model.Helper.Security.GetMemberID();
            }

            RenewalViewModel         model         = new RenewalViewModel(id);
            PropertyViewModel        propertyModel = new PropertyViewModel();
            VehicleScheduleViewModel vehicleModel  = new VehicleScheduleViewModel();
            DriverInfoViewModel      driverModel   = new DriverInfoViewModel();
            DocumentViewModel        docModel      = new DocumentViewModel();

            if (model.CheckRenewalExists(id))
            {
                model.GetRenewalRecord(id, model.GetMemberCoverageID(id));

                if (model.IsLocked(model.RenewalID, BHIP.Model.Helper.Security.GetLoggedInUserID()))
                {
                    Response.Redirect("/Renewal/Locked");
                }
                else
                {
                    model.LockRenewal(model.RenewalID, BHIP.Model.Helper.Security.GetLoggedInUserID());
                }
                model.MemberCoverageID   = model.GetMemberCoverageID(id);
                model.TotalBuilding      = propertyModel.TotalBuildingValue(model.GetMemberCoverageID(id));
                model.TotalContent       = propertyModel.TotalContentValue(model.GetMemberCoverageID(id));
                model.TotalFootage       = propertyModel.TotalSquareFeet(model.GetMemberCoverageID(id));
                model.InspectionBodyGrid = model.GetInpsectionBody(model.RenewalID);
                model.HandleFundsGrid    = model.GetHandleFunds(model.RenewalID);

                model.Attachments = docModel.GetDocuments(model.RenewalID);

                if (model.TotalFootage > 0)
                {
                    model.CostSquareFoot = (model.TotalBuilding + model.TotalContent) / model.TotalFootage;
                }
                else
                {
                    model.CostSquareFoot = 0;
                }
                model.TotalInsurable = model.TotalBuilding + model.TotalContent;
            }
            else
            {
                if (id > 0)
                {
                    renewalId = model.CreateRenewalRecord(id);
                    model.MemberCoverageID = model.GetMemberCoverageID(id);
                    model.GetRenewalRecord(id, model.GetMemberCoverageID(id));
                    model.InitializeQuestions(renewalId, id);
                    model.InspectionBodyGrid = model.GetInpsectionBody(0);
                    model.HandleFundsGrid    = model.GetHandleFunds(0);
                    model.TotalAutos         = vehicleModel.TotalAutos(model.GetMemberCoverageID(id));
                    model.TotalDrivers       = driverModel.TotalDrivers(model.GetMemberCoverageID(id));

                    model.TotalBuilding = propertyModel.TotalBuildingValue(model.GetMemberCoverageID(id));
                    model.TotalContent  = propertyModel.TotalContentValue(model.GetMemberCoverageID(id));
                    model.TotalFootage  = propertyModel.TotalSquareFeet(model.GetMemberCoverageID(id));
                    if (model.TotalFootage > 0)
                    {
                        model.CostSquareFoot = (model.TotalBuilding + model.TotalContent) / model.TotalFootage;
                    }
                    else
                    {
                        model.CostSquareFoot = 0;
                    }
                    model.TotalInsurable = model.TotalBuilding + model.TotalContent;
                    model.Attachments    = new DocumentViewModel[0];
                }
                else
                {
                    model.MemberID            = id;
                    model.ContactList         = new ContactScheduleViewModel[0];
                    model.ContactHoldList     = new ContactScheduleHoldViewModel[0];
                    model.LicenseList         = new LicenseViewModel[0];
                    model.AgencyPlanList      = new AgencyPlanViewModel[0];
                    model.HandleFundsGrid     = model.GetHandleFunds(0);
                    model.InspectionBodyGrid  = model.GetInpsectionBody(0);
                    model.PsychiatryList      = new PsychiatryViewModel[0];
                    model.PsychiatryHoldList  = new PsychiatryScheduleHoldViewModel[0];
                    model.PrimaryCareList     = new PrimaryCareViewModel[0];
                    model.PrimaryCareHoldList = new PrimaryCareHoldViewModel[0];
                    model.VehicleList         = new VehicleScheduleViewModel[0];
                    model.VehicleHoldList     = new VehicleScheduleHoldViewModel[0];
                    model.DriverInfoList      = new DriverInfoViewModel[0];
                    model.DriverInfoHoldList  = new DriverInfoHoldViewModel[0];
                    model.PropertyList        = new PropertyViewModel[0];
                    model.PropertyHoldList    = new PropertyScheduleHoldViewModel[0];
                    model.Attachments         = new DocumentViewModel[0];
                }
            }

            if (model.Submitted == true && User.IsInRole("Administrator") != true)
            {
                model.IsRenewLocked = true;
            }
            model.UserRoles = model.GetUserRoles();
            return(View(model));
        }