public PartialViewResult GetSecurityDepositView(bool IsView, string SecurityID) { var model = new SecurityDepositModel(); 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 lstType = new SelectList(_clsGlobal.GetListOfValue("SECURITY_ITEM_STATUS", "", "O", "", ""), "Value", "Text"); ViewBag.StatusList = lstType; if (!string.IsNullOrEmpty(SecurityID)) { model = _clsSecurity.GetSecurityDepositDetails(SecurityID); } if (model != null) { address = new SelectList(_clsCRM.getAddress(model.BillToDetailModel.Customer, model.BillToDetailModel.IndividualCorporate), "AddressId", "Address"); departmentList = new SelectList(_clsCRM.getDepartmentList(model.BillToDetailModel.Address), "cd_ref_num", "cd_dept_desc"); contact = new SelectList(_clsCRM.getContactPerson(model.BillToDetailModel.Department), "Value", "Contact"); if (model.BillToDetailModel.IndividualCorporate == clsVariables.Individual) { model.BillToDetailModel.NRICFINPASSPORT = _clsCRM.getNricFinPassportType(model.BillToDetailModel.Customer); } else { model.BillToDetailModel.ROCUEN = _clsCRM.getRocUenType(model.BillToDetailModel.Customer); } } ViewBag.Address = address; ViewBag.DepartmentList = departmentList; ViewBag.Contact = contact; ViewBag.Viewable = IsView; return(PartialView("_SecurityDepositPartialView", model)); }