// GET: /List public ActionResult List(int id, int?page) { ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); //Check Exists if (clientDetail == null) { ViewData["ActionMethod"] = "List"; return(View("RecordDoesNotExistError")); } ClientDetailClientSubUnitTravelerType clientDetailClientSubUnitTravelerType = new ClientDetailClientSubUnitTravelerType(); clientDetailClientSubUnitTravelerType = clientDetailClientSubUnitTravelerTypeRepository.GetClientDetailClientSubUnitTravelerType(id); //Check Exists if (clientDetailClientSubUnitTravelerType == null) { ViewData["ActionMethod"] = "List"; return(View("RecordDoesNotExistError")); } string csu = clientDetailClientSubUnitTravelerType.ClientSubUnitGuid; string tt = clientDetailClientSubUnitTravelerType.TravelerTypeGuid; ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu); //Access Rights ViewData["Access"] = ""; RolesRepository rolesRepository = new RolesRepository(); if (rolesRepository.HasWriteAccessToClientSubUnit(csu)) { ViewData["Access"] = "WriteAccess"; } //Populate View Model ClientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM clientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM = new ClientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM(); clientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM.SubProductFormOfPaymentTypes = clientDetailRepository.ListClientDetailSubProductFormOfPaymentTypes(id, page ?? 1); clientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM.ClientSubUnit = clientSubUnit; clientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM.ClientDetail = clientDetail; return(View(clientSubUnitTravelerTypeSubProductFormOfPaymentTypesVM)); }
// GET: /List public ActionResult List(int id, int?page) { ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); //Check Exists if (clientDetail == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } ClientDetailClientAccount clientDetailClientAccount = new ClientDetailClientAccount(); clientDetailClientAccount = clientDetailClientAccountRepository.GetClientDetailClientAccount(id); //Check Exists if (clientDetailClientAccount == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } string can = clientDetailClientAccount.ClientAccountNumber; string ssc = clientDetailClientAccount.SourceSystemCode; ClientAccount clientAccount = new ClientAccount(); clientAccount = clientAccountRepository.GetClientAccount(can, ssc); //Access Rights ViewData["Access"] = ""; RolesRepository rolesRepository = new RolesRepository(); if (rolesRepository.HasWriteAccessToClientSubUnit(can)) { ViewData["Access"] = "WriteAccess"; } //Populate View Model ClientAccountSubProductFormOfPaymentTypesVM clientAccountSubProductFormOfPaymentTypesVM = new ClientAccountSubProductFormOfPaymentTypesVM(); clientAccountSubProductFormOfPaymentTypesVM.SubProductFormOfPaymentTypes = clientDetailRepository.ListClientDetailSubProductFormOfPaymentTypes(id, page ?? 1); clientAccountSubProductFormOfPaymentTypesVM.ClientAccount = clientAccount; clientAccountSubProductFormOfPaymentTypesVM.ClientDetail = clientDetail; return(View(clientAccountSubProductFormOfPaymentTypesVM)); }