// GET: /List public ActionResult List(string csu, string tt, int id, int?page) { ClientDetailTravelerType clientDetailTravelerType = new ClientDetailTravelerType(); clientDetailTravelerType = clientDetailTravelerTypeRepository.GetClientDetailTravelerType(id); //Check Exists if (clientDetailTravelerType == null) { ViewData["ActionMethod"] = "List"; return(View("RecordDoesNotExistError")); } ClientSubUnitTravelerType clientSubUnitTravelerType = new ClientSubUnitTravelerType(); clientSubUnitTravelerType = clientSubUnitTravelerTypeRepository.GetClientSubUnitTravelerType(csu, tt); //Check Exists if (clientDetailTravelerType == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } //Access Rights ViewData["Access"] = ""; RolesRepository rolesRepository = new RolesRepository(); if (rolesRepository.HasWriteAccessToClientSubUnit(csu)) { ViewData["Access"] = "WriteAccess"; } //Populate View Model TravelerTypeSupplierProductsVM travelerTypeSupplierProductsVM = new TravelerTypeSupplierProductsVM(); travelerTypeSupplierProductsVM.SupplierProducts = clientDetailRepository.ListClientDetailSupplierProducts(id, page ?? 1); ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu); travelerTypeSupplierProductsVM.ClientSubUnit = clientSubUnit; ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); travelerTypeSupplierProductsVM.ClientDetail = clientDetail; TravelerType travelerType = new TravelerType(); travelerType = travelerTypeRepository.GetTravelerType(tt); travelerTypeSupplierProductsVM.TravelerType = travelerType; //Return Form return(View(travelerTypeSupplierProductsVM)); }
// 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")); } ClientDetailClientAccount clientDetailClientAccount = new ClientDetailClientAccount(); clientDetailClientAccount = clientDetailClientAccountRepository.GetClientDetailClientAccount(id); //Check Exists if (clientDetailClientAccount == null) { ViewData["ActionMethod"] = "List"; 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.HasWriteAccessToClientAccount(can, ssc)) { ViewData["Access"] = "WriteAccess"; } //Populate View Model ClientAccountSupplierProductsVM clientAccountSupplierProductsVM = new ClientAccountSupplierProductsVM(); clientAccountSupplierProductsVM.SupplierProducts = clientDetailRepository.ListClientDetailSupplierProducts(id, page ?? 1); clientAccountSupplierProductsVM.ClientAccount = clientAccount; clientAccountSupplierProductsVM.ClientDetail = clientDetail; //Return Form return(View(clientAccountSupplierProductsVM)); }