예제 #1
0
        // GET: Policy/Create
        public ActionResult Create(int?ClientId, string returnUrl)
        {
            if (ClientId.HasValue == false)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            PolicyDetailModel vm = new PolicyDetailModel()
            {
                Companies     = ListProviderSvc.GetInsuranceProviders(),
                PolicyTypes   = ListProviderSvc.GetPolicyTypes(),
                Statuses      = ListProviderSvc.GetPolicyStatuses(),
                Agents        = ListProviderSvc.GetAgents(),
                InceptionDate = DateTime.Now,
                DateIssued    = DateTime.Now,
                ExpiryDate    = DateTime.Now,
                StatusName    = "New",
                ReturnUrl     = returnUrl,
                ClientId      = (int)ClientId
            };

            List <ClientSimple> clients = null;

            if (ClientId == 0)
            {
                clients = ListProviderSvc.GetClientSimpleList();
            }
            else
            {
                clients = new List <ClientSimple>();
                var clientEntity = Uow.Clients.GetById((int)ClientId);
                if (clientEntity == null)
                {
                    return(HttpNotFound());
                }
                ClientSimple client = new ClientSimple
                {
                    Id = clientEntity.Id,
                };
                if (clientEntity.IsOrganization)
                {
                    client.ClientName = clientEntity.OrganizationName;
                }
                else
                {
                    client.ClientName = clientEntity.LastName + ", " + clientEntity.FirstName;
                }

                clients.Add(client);
            }
            vm.Clients = clients;

            List <DefaultRebate> defaultRebates = null;

            defaultRebates    = ListProviderSvc.GetDefaultRebates();
            vm.DefaultRebates = defaultRebates;

            return(View(vm));
        }
예제 #2
0
        //private const string FileLocationFolderDbSave = "./Content/Files/";
        // GET: Form
        public ActionResult Index()
        {
            var formsList = Uow.Forms.GetAll()
                            .ProjectTo <FormModel>()
                            .ToList();
            var documentTypeList      = ListProviderSvc.GetDocumentTypes();
            var insuranceProviderList = ListProviderSvc.GetInsuranceProviders();
            var clientList            = ListProviderSvc.GetClientSimpleList();

            var formViewModel = new FormViewModel
            {
                NewForm            = new FormModel(),
                FormsList          = formsList,
                DocumentTypes      = documentTypeList,
                InsuranceProviders = insuranceProviderList,
                Clients            = clientList
            };

            return(View(formViewModel));
        }
예제 #3
0
        private PolicyDetailModel GetPolicyDetailModel(int?id)
        {
            var policyDetailModel = Uow.Policies.GetAll()
                                    .Where(c => c.Id == id)
                                    .ProjectTo <PolicyDetailModel>()
                                    .FirstOrDefault();

            if (policyDetailModel.IsOrganization)
            {
                policyDetailModel.ClientName = policyDetailModel.OrganizationName;
            }

            policyDetailModel.Companies   = ListProviderSvc.GetInsuranceProviders();
            policyDetailModel.PolicyTypes = ListProviderSvc.GetPolicyTypes();
            policyDetailModel.Statuses    = ListProviderSvc.GetPolicyStatuses();
            policyDetailModel.Agents      = ListProviderSvc.GetAgents();
            policyDetailModel.Clients     = ListProviderSvc.GetClientSimpleList();

            return(policyDetailModel);
        }