コード例 #1
0
        public PartialViewResult GetCashAndEquivalentIndividual(bool IsView, string SecurityId)
        {
            CashEquivalentModel model = new CashEquivalentModel();

            SelectList guaranteeBondsType = new SelectList(_clsGlobal.GetListOfValue("CASH_EQUIVALENT_GUARANTEE_BONDS_TYPE", "", "O", "", ""), "Value", "Text");

            ViewBag.GuaranteeBondsTypeList = guaranteeBondsType;
            SelectList address        = new SelectList(new List <AddressViewModel>(), "AddressId", "Address");
            SelectList departmentList = new SelectList(new List <DepartmentViewModel>(), "cd_ref_num", "cd_dept_desc");
            SelectList contact        = new SelectList(new List <ContactPersonModel>(), "Value", "Contact");
            SelectList lstStatus      = new SelectList(_clsGlobal.GetListOfValue("SECURITY_ITEM_STATUS", "", "O", "", ""), "Value", "Text");

            ViewBag.StatusList = lstStatus;

            if (!string.IsNullOrEmpty(SecurityId))
            {
                model = _clsSecurity.GetCashAndEquivalentIndividualDetails(SecurityId);
                if (model != null)
                {
                    if (model.BillToModel != null)
                    {
                        address        = new SelectList(_clsCRM.getAddress(model.BillToModel.Customer, clsVariables.Individual), "AddressId", "Address");
                        departmentList = new SelectList(_clsCRM.getDepartmentList(model.BillToModel.Address), "cd_ref_num", "cd_dept_desc");
                        contact        = new SelectList(_clsCRM.getContactPerson(model.BillToModel.Department), "Value", "Contact");
                        model.BillToModel.NricFinPassport = _clsCRM.getNricFinPassportType(model.BillToModel.Customer);
                    }
                }
            }

            ViewBag.AddressList    = address;
            ViewBag.DepartmentList = departmentList;
            ViewBag.Contact        = contact;
            ViewBag.Viewable       = IsView;

            return(PartialView("_CashAndEquivalentIndividualPartial", model));
        }