// 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 ClientSubUnitTravelerTypeSupplierProductsVM clientSubUnitTravelerTypeSupplierProductsVM = new ClientSubUnitTravelerTypeSupplierProductsVM(); clientSubUnitTravelerTypeSupplierProductsVM.SupplierProducts = clientDetailRepository.ListClientDetailSupplierProducts(id, page ?? 1); clientSubUnitTravelerTypeSupplierProductsVM.ClientSubUnit = clientSubUnit; clientSubUnitTravelerTypeSupplierProductsVM.ClientDetail = clientDetail; TravelerType travelerType = new TravelerType(); travelerType = travelerTypeRepository.GetTravelerType(tt); clientSubUnitTravelerTypeSupplierProductsVM.TravelerType = travelerType; //Return Form return(View(clientSubUnitTravelerTypeSupplierProductsVM)); }
// GET: /ListSubMenu public ActionResult ListSubMenu(int id) { ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); //Check Exists if (clientDetail == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } ClientDetailClientSubUnit clientDetailClientSubUnit = new ClientDetailClientSubUnit(); clientDetailClientSubUnit = clientDetailClientSubUnitRepository.GetClientDetailClientSubUnit(id); //Check Exists if (clientDetailClientSubUnit == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(clientDetailClientSubUnit.ClientSubUnitGuid); ClientSubUnitClientDetailVM clientAccountClientDetailVM = new ClientSubUnitClientDetailVM(); clientAccountClientDetailVM.ClientSubUnit = clientSubUnit; clientAccountClientDetailVM.ClientDetail = clientDetail; return(View(clientAccountClientDetailVM)); }
// 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)); }
// 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")); } ClientDetailClientSubUnit clientDetailClientSubUnit = new ClientDetailClientSubUnit(); clientDetailClientSubUnit = clientDetailClientSubUnitRepository.GetClientDetailClientSubUnit(id); //Check Exists if (clientDetailClientSubUnit == null) { ViewData["ActionMethod"] = "List"; return(View("RecordDoesNotExistError")); } string clientTopUnitGuid = clientDetailClientSubUnit.ClientSubUnitGuid; ClientSubUnit clientTopUnit = new ClientSubUnit(); clientTopUnit = clientSubUnitRepository.GetClientSubUnit(clientTopUnitGuid); //Access Rights ViewData["Access"] = ""; RolesRepository rolesRepository = new RolesRepository(); if (rolesRepository.HasWriteAccessToClientSubUnit(clientTopUnitGuid)) { ViewData["Access"] = "WriteAccess"; } //Populate View Model ClientSubUnitSubProductFormOfPaymentTypesVM clientTopUnitSubProductFormOfPaymentTypesVM = new ClientSubUnitSubProductFormOfPaymentTypesVM(); clientTopUnitSubProductFormOfPaymentTypesVM.SubProductFormOfPaymentTypes = clientDetailRepository.ListClientDetailSubProductFormOfPaymentTypes(id, page ?? 1); clientTopUnitSubProductFormOfPaymentTypesVM.ClientSubUnit = clientTopUnit; clientTopUnitSubProductFormOfPaymentTypesVM.ClientDetail = clientDetail; return(View(clientTopUnitSubProductFormOfPaymentTypesVM)); }
// 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"] = "List"; return(View("RecordDoesNotExistError")); } //Access Rights ViewData["Access"] = ""; RolesRepository rolesRepository = new RolesRepository(); if (rolesRepository.HasWriteAccessToClientSubUnit(csu)) { ViewData["Access"] = "WriteAccess"; } //Populate View Model TravelerTypeAddressesVM travelerTypeAddressesVM = new TravelerTypeAddressesVM(); travelerTypeAddressesVM.Addresses = clientDetailRepository.ListClientDetailAddresses(id, page ?? 1); ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu); travelerTypeAddressesVM.ClientSubUnit = clientSubUnit; ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); travelerTypeAddressesVM.ClientDetail = clientDetail; TravelerType travelerType = new TravelerType(); travelerType = travelerTypeRepository.GetTravelerType(tt); travelerTypeAddressesVM.TravelerType = travelerType; return(View(travelerTypeAddressesVM)); }
// GET: /ListSubMenu public ActionResult ListSubMenu(int id) { ClientDetail clientDetail = new ClientDetail(); clientDetail = clientDetailRepository.GetGroup(id); //Check Exists if (clientDetail == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } ClientDetailClientSubUnitTravelerType clientDetailClientSubUnitTravelerType = new ClientDetailClientSubUnitTravelerType(); clientDetailClientSubUnitTravelerType = clientDetailClientSubUnitTravelerTypeRepository.GetClientDetailClientSubUnitTravelerType(id); //Check Exists if (clientDetailClientSubUnitTravelerType == null) { ViewData["ActionMethod"] = "ListSubMenu"; return(View("RecordDoesNotExistError")); } string csu = clientDetailClientSubUnitTravelerType.ClientSubUnitGuid; string tt = clientDetailClientSubUnitTravelerType.TravelerTypeGuid; ClientSubUnitTravelerTypeClientDetailVM clientSubUnitTravelerTypeClientDetailVM = new ClientSubUnitTravelerTypeClientDetailVM(); clientSubUnitTravelerTypeClientDetailVM.ClientDetail = clientDetail; ClientSubUnit clientSubUnit = new ClientSubUnit(); clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu); clientSubUnitTravelerTypeClientDetailVM.ClientSubUnit = clientSubUnit; TravelerType travelerType = new TravelerType(); travelerType = travelerTypeRepository.GetTravelerType(tt); clientSubUnitTravelerTypeClientDetailVM.TravelerType = travelerType; return(View(clientSubUnitTravelerTypeClientDetailVM)); }