public ActionResult Create(string id) { //Set Access Rights ViewData["Access"] = ""; if (rolesRepository.HasWriteAccessToSystemUserGDSAccessRights(id)) { ViewData["Access"] = "WriteAccess"; } SystemUserGDSAccessRightVM SystemUserGDSAccessRightVM = new SystemUserGDSAccessRightVM(); SystemUserGDSAccessRight SystemUserGDSAccessRight = new SystemUserGDSAccessRight(); SystemUserGDSAccessRightVM.SystemUserGDSAccessRight = SystemUserGDSAccessRight; //GDS SystemUserGDSAccessRightVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); //GDSAccessTypes SystemUserGDSAccessRightVM.GDSAccessTypes = new SelectList(gdsAccessTypeRepository.GetAllGDSAccessTypes().ToList(), "GDSAccessTypeId", "GDSAccessTypeName"); //SystemUser SystemUser systemUser = new SystemUser(); systemUser = systemUserRepository.GetUserBySystemUserGuid(id); if (systemUser != null) { SystemUserGDSAccessRightVM.SystemUser = systemUser; SystemUserGDSAccessRightVM.SystemUserGDSAccessRight.SystemUserGuid = systemUser.SystemUserGuid; } return(View(SystemUserGDSAccessRightVM)); }
public ActionResult Create(string id) { //Set Access Rights ViewData["Access"] = ""; if (rolesRepository.HasWriteAccessToServiceAccounts()) { ViewData["Access"] = "WriteAccess"; } ServiceAccountGDSAccessRightVM serviceAccountGDSAccessRightVM = new ServiceAccountGDSAccessRightVM(); ServiceAccountGDSAccessRight serviceAccountGDSAccessRight = new ServiceAccountGDSAccessRight(); serviceAccountGDSAccessRightVM.ServiceAccountGDSAccessRight = serviceAccountGDSAccessRight; //GDS serviceAccountGDSAccessRightVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); //GDSAccessTypes serviceAccountGDSAccessRightVM.GDSAccessTypes = new SelectList(gdsAccessTypeRepository.GetAllGDSAccessTypes().ToList(), "GDSAccessTypeId", "GDSAccessTypeName"); //ServiceAccount ServiceAccount serviceAccount = new ServiceAccount(); serviceAccount = serviceAccountRepository.GetServiceAccount(id); if (serviceAccount != null) { serviceAccountGDSAccessRightVM.ServiceAccount = serviceAccount; serviceAccountGDSAccessRightVM.ServiceAccountGDSAccessRight.ServiceAccountId = serviceAccount.ServiceAccountId; } return(View(serviceAccountGDSAccessRightVM)); }
public ActionResult Create(int id) { //Set Access Rights ViewData["Access"] = ""; if (rolesRepository.HasWriteAccessToThirdPartyGDSAccessRights(id)) { ViewData["Access"] = "WriteAccess"; } ThirdPartyUserGDSAccessRightVM thirdPartyUserGDSAccessRightVM = new ThirdPartyUserGDSAccessRightVM(); ThirdPartyUserGDSAccessRight thirdPartyUserGDSAccessRight = new ThirdPartyUserGDSAccessRight(); thirdPartyUserGDSAccessRightVM.ThirdPartyUserGDSAccessRight = thirdPartyUserGDSAccessRight; //GDS thirdPartyUserGDSAccessRightVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); //GDSAccessTypes thirdPartyUserGDSAccessRightVM.GDSAccessTypes = new SelectList(gdsAccessTypeRepository.GetAllGDSAccessTypes().ToList(), "GDSAccessTypeId", "GDSAccessTypeName"); //ThirdPartyUser ThirdPartyUser thirdPartyUser = new ThirdPartyUser(); thirdPartyUser = thirdPartyUserRepository.GetThirdPartyUser(id); if (thirdPartyUser != null) { thirdPartyUserRepository.EditForDisplay(thirdPartyUser); thirdPartyUserGDSAccessRightVM.ThirdPartyUser = thirdPartyUser; thirdPartyUserGDSAccessRightVM.ThirdPartyUserGDSAccessRight.ThirdPartyUserId = thirdPartyUser.ThirdPartyUserId; } return(View(thirdPartyUserGDSAccessRightVM)); }
// GET: Edit A Single ClientFee public ActionResult Edit(int id) { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ClientFee clientFee = new ClientFee(); clientFee = clientFeeRepository.GetItem(id); //Check Exists if (clientFee == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Change DisplayText for Transaction Fees FeeType feeType = new FeeType(); feeType = clientFee.FeeType; if (feeType.FeeTypeDescription == "Client Fee") { feeType.FeeTypeDescription = "Transaction Fee"; } ClientFeeVM clientFeeVM = new ClientFeeVM(); clientFeeVM.ClientFee = clientFee; GDSRepository gdsRepository = new GDSRepository(); clientFeeVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName", clientFee.GDSCode); ContextRepository contextRepository = new ContextRepository(); clientFeeVM.Contexts = new SelectList(contextRepository.GetAllContexts().ToList(), "ContextId", "ContextName", clientFee.ContextId); //Check for missing GDS if (clientFee.GDS == null) { GDS gds = new GDS(); clientFee.GDS = gds; } ClientFeeOutput clientFeeOutput = new ClientFeeOutput(); if (clientFee.ClientFeeOutputs.Count > 0) { clientFeeOutput = clientFeeOutputRepository.GetItem(clientFee.ClientFeeOutputs[0].ClientFeeOutputId); } clientFeeVM.ClientFeeOutput = clientFeeOutput; return(View(clientFeeVM)); }
// GET: Create A Single ClientFee public ActionResult Create() { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ClientFeeVM clientFeeVM = new ClientFeeVM(); ClientFee clientFee = new ClientFee(); FeeType feeType = new FeeType(); clientFee.FeeType = feeType; clientFeeVM.ClientFee = clientFee; FeeTypeRepository feeTypeRepository = new FeeTypeRepository(); clientFeeVM.FeeTypes = feeTypeRepository.GetAllFeeTypes().ToList(); GDSRepository gdsRepository = new GDSRepository(); clientFeeVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ContextRepository contextRepository = new ContextRepository(); clientFeeVM.Contexts = new SelectList(contextRepository.GetAllContexts().ToList(), "ContextId", "ContextName"); return(View(clientFeeVM)); }
public ActionResult Create() { //Set Access Rights ViewData["Access"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Access"] = "WriteAccess"; } FareRedistributionVM fareRedistributionVM = new FareRedistributionVM(); FareRedistribution fareRedistribution = new FareRedistribution(); fareRedistributionVM.FareRedistribution = fareRedistribution; //GDS fareRedistributionVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); return(View(fareRedistributionVM)); }
public ActionResult Create() { //Set Access Rights ViewData["Access"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Access"] = "WriteAccess"; } GDSAccessTypeVM gdsAccessTypeVM = new GDSAccessTypeVM(); GDSAccessType gdsAccessType = new GDSAccessType(); gdsAccessTypeVM.GDSAccessType = gdsAccessType; //GDS gdsAccessTypeVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); return(View(gdsAccessTypeVM)); }
// GET: /Edit public ActionResult Edit(int id) { //Get Item From Database GDSAdditionalEntry group = new GDSAdditionalEntry(); group = gDSAdditionalEntryRepository.GetGroup(id); //Check Exists if (group == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Access RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToGDSAdditionalEntry(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); ViewData["TripTypes"] = tripTypesList; GDSRepository gdsRepository = new GDSRepository(); SelectList gDSList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gDSList; PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository(); SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName"); ViewData["PNROutputTypes"] = pNROutputTypeList; gDSAdditionalEntryRepository.EditGroupForDisplay(group); //Populate List of Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName", group.ProductId); ViewData["ProductList"] = products; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); ViewData["HierarchyTypes"] = hierarchyTypesList; return(View(group)); }
// GET: /Edit public ActionResult Edit(int id) { //Get Item From Database PolicyGroup group = new PolicyGroup(); group = policyGroupRepository.GetGroup(id); //Check Exists if (group == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Access RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToPolicyGroup(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); ViewData["tripTypes"] = tripTypesList; GDSRepository gdsRepository = new GDSRepository(); SelectList gDSList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gDSList; PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository(); SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName"); ViewData["PNROutputTypes"] = pNROutputTypeList; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); ViewData["HierarchyTypes"] = hierarchyTypesList; policyGroupRepository.EditGroupForDisplay(group); //Meetings MeetingRepository meetingRepository = new MeetingRepository(); List <Meeting> meetings = meetingRepository.GetAvailableMeetings(group.HierarchyType, group.HierarchyCode, null, group.SourceSystemCode, group.TravelerTypeGuid); SelectList meetingsList = new SelectList(meetings.ToList(), "MeetingID", "MeetingDisplayName", group.MeetingID != null ? group.MeetingID.ToString() : ""); ViewData["Meetings"] = meetingsList; return(View(group)); }
public ActionResult Create() { //AccessRights RolesRepository rolesRepository = new RolesRepository(); if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } GDSContactVM GDSContactVM = new GDSContactVM(); //Create Item GDSContact gdsContact = new GDSContact(); //Countries GDSContactVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName"); //GDS GDSContactVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); //GDSRegions GDSContactVM.GlobalRegions = new SelectList(hierarchyRepository.GetAllGlobalRegions().ToList(), "GlobalRegionCode", "GlobalRegionName"); //GDSRequestTypes GDSContactVM.GDSRequestTypes = new SelectList(gdsRequestTypeRepository.GetAllGDSRequestTypes().ToList(), "GDSRequestTypeId", "GDSRequestTypeName"); //PseudoCityOrOfficeBusinesses GDSContactVM.PseudoCityOrOfficeBusinesses = new SelectList(pseudoCityOrOfficeBusinessRepository.GetAllPseudoCityOrOfficeBusinesses().ToList(), "PseudoCityOrOfficeBusinessId", "PseudoCityOrOfficeBusinessName"); //PseudoCityOrOfficeDefinedRegions GDSContactVM.PseudoCityOrOfficeDefinedRegions = new SelectList(pseudoCityOrOfficeDefinedRegionRepository.GetAllPseudoCityOrOfficeDefinedRegions().ToList(), "PseudoCityOrOfficeDefinedRegionId", "PseudoCityOrOfficeDefinedRegionName"); GDSContactVM.GDSContact = gdsContact; return(View(GDSContactVM)); }
public ActionResult Create(int id) { //Get QueueMinderGroup QueueMinderGroup queueMinderGroup = new QueueMinderGroup(); queueMinderGroup = queueMinderGroupRepository.GetGroup(id); //Check Exists if (queueMinderGroup == null) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToQueueMinderGroup(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } QueueMinderItemVM queueMinderItemVM = new QueueMinderItemVM(); QueueMinderItem queueMinderItem = new QueueMinderItem(); queueMinderItem.QueueMinderGroup = queueMinderGroup; queueMinderItemVM.QueueMinderItem = queueMinderItem; GDSRepository gDSRepository = new GDSRepository(); SelectList gDSs = new SelectList(gDSRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); queueMinderItemVM.GDSs = gDSs; ContextRepository contextRepository = new ContextRepository(); SelectList contexts = new SelectList(contextRepository.GetAllContexts().ToList(), "ContextId", "ContextName"); queueMinderItemVM.Contexts = contexts; //DONT SHOW 17,18,19 UNLESS ROLE ALLOWS QueueMinderTypeRepository queueMinderTypeRepository = new QueueMinderTypeRepository(); SelectList queueMinderTypes = new SelectList(queueMinderTypeRepository.GetAllQueueMinderTypes().ToList(), "QueueMinderTypeId", "QueueMinderTypeDescription"); queueMinderItemVM.QueueMinderTypes = queueMinderTypes; return(View(queueMinderItemVM)); }
// GET: /Edit public ActionResult Edit(int id) { //AccessRights TicketQueueItem ticketQueueItem = new TicketQueueItem(); ticketQueueItem = ticketQueueItemRepository.GetItem(id); //Check Exists if (ticketQueueItem == null) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToTicketQueueGroup(ticketQueueItem.TicketQueueGroupId)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TicketTypeRepository ticketTypeRepository = new TicketTypeRepository(); SelectList ticketTypeList = new SelectList(ticketTypeRepository.GetAllTicketTypes().ToList(), "TicketTypeId", "TicketTypeDescription"); ViewData["TicketTypes"] = ticketTypeList; GDSRepository gdsRepository = new GDSRepository(); SelectList gdsList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gdsList; //Parent Information ViewData["TicketQueueGroupId"] = ticketQueueItem.TicketQueueGroupId; ViewData["TicketQueueGroupName"] = ticketQueueGroupRepository.GetGroup(ticketQueueItem.TicketQueueGroupId).TicketQueueGroupName; //Add Linked Information ticketQueueItemRepository.EditItemForDisplay(ticketQueueItem); //Show To User return(View(ticketQueueItem)); }
// GET: /Create public ActionResult Create(int Id) { //Get WorkFlowGroup TicketQueueGroup ticketQueueGroup = new TicketQueueGroup(); ticketQueueGroup = ticketQueueGroupRepository.GetGroup(Id); //Check Exists if (ticketQueueGroup == null) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToTicketQueueGroup(Id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TicketTypeRepository ticketTypeRepository = new TicketTypeRepository(); SelectList ticketTypeList = new SelectList(ticketTypeRepository.GetAllTicketTypes().ToList(), "TicketTypeId", "TicketTypeDescription"); ViewData["TicketTypes"] = ticketTypeList; GDSRepository gdsRepository = new GDSRepository(); SelectList gdsList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gdsList; TicketQueueItem ticketQueueItem = new TicketQueueItem(); ticketQueueItem.TicketQueueGroupId = ticketQueueGroup.TicketQueueGroupId; ticketQueueItem.TicketQueueGroupName = ticketQueueGroup.TicketQueueGroupName; return(View(ticketQueueItem)); }
// GET: /Create public ActionResult Create() { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); ViewData["TripTypes"] = tripTypesList; GDSRepository gdsRepository = new GDSRepository(); SelectList gDSList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gDSList; PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository(); SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName"); ViewData["PNROutputTypes"] = pNROutputTypeList; //Populate List of Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); ViewData["ProductList"] = products; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); ViewData["HierarchyTypes"] = hierarchyTypesList; GDSAdditionalEntry group = new GDSAdditionalEntry(); return(View(group)); }
// GET: /Create public ActionResult Create() { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); ViewData["TripTypes"] = tripTypesList; GDSRepository gdsRepository = new GDSRepository(); SelectList gDSList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gDSList; PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository(); SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName"); ViewData["PNROutputTypes"] = pNROutputTypeList; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); ViewData["HierarchyTypes"] = hierarchyTypesList; List <Meeting> meetings = new List <Meeting>(); SelectList meetingsList = new SelectList(meetings.ToList(), "MeetingID", "MeetingName"); ViewData["Meetings"] = meetingsList; PolicyGroup group = new PolicyGroup(); return(View(group)); }
// GET: /Edit public ActionResult Edit(int id) { //Set Access Rights ViewData["Access"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Access"] = "WriteAccess"; } PseudoCityOrOfficeMaintenance pseudoCityOrOfficeMaintenance = pseudoCityOrOfficeMaintenanceRepository.GetPseudoCityOrOfficeMaintenance(id); //Check Exists if (pseudoCityOrOfficeMaintenance == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Access if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } PseudoCityOrOfficeMaintenanceVM pseudoCityOrOfficeMaintenanceVM = new PseudoCityOrOfficeMaintenanceVM(); //Checkboxes pseudoCityOrOfficeMaintenance.ActiveFlagNonNullable = pseudoCityOrOfficeMaintenance.ActiveFlag.Value; pseudoCityOrOfficeMaintenance.SharedPseudoCityOrOfficeFlagNonNullable = pseudoCityOrOfficeMaintenance.SharedPseudoCityOrOfficeFlag.Value; pseudoCityOrOfficeMaintenance.CWTOwnedPseudoCityOrOfficeFlagNonNullable = pseudoCityOrOfficeMaintenance.CWTOwnedPseudoCityOrOfficeFlag.Value; pseudoCityOrOfficeMaintenance.ClientDedicatedPseudoCityOrOfficeFlagNonNullable = pseudoCityOrOfficeMaintenance.ClientDedicatedPseudoCityOrOfficeFlag.Value; pseudoCityOrOfficeMaintenance.ClientGDSAccessFlagNonNullable = pseudoCityOrOfficeMaintenance.ClientGDSAccessFlag.Value; pseudoCityOrOfficeMaintenance.DevelopmentOrInternalPseudoCityOrOfficeFlagNonNullable = pseudoCityOrOfficeMaintenance.DevelopmentOrInternalPseudoCityOrOfficeFlag.Value; pseudoCityOrOfficeMaintenance.CubaPseudoCityOrOfficeFlagNonNullable = pseudoCityOrOfficeMaintenance.CubaPseudoCityOrOfficeFlag.Value; pseudoCityOrOfficeMaintenance.GovernmentPseudoCityOrOfficeFlagNonNullable = pseudoCityOrOfficeMaintenance.GovernmentPseudoCityOrOfficeFlag.Value; pseudoCityOrOfficeMaintenance.GDSThirdPartyVendorFlagNonNullable = pseudoCityOrOfficeMaintenance.GDSThirdPartyVendorFlag.Value; pseudoCityOrOfficeMaintenanceRepository.EditForDisplay(pseudoCityOrOfficeMaintenance); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeMaintenance = pseudoCityOrOfficeMaintenance; //IATAs IATARepository iataRepository = new IATARepository(); pseudoCityOrOfficeMaintenanceVM.IATAs = new SelectList(iataRepository.GetAllIATAs().ToList(), "IATAId", "IATANumber", pseudoCityOrOfficeMaintenance.IATAId); //GDSs GDSRepository GDSRepository = new GDSRepository(); pseudoCityOrOfficeMaintenanceVM.GDSs = new SelectList(GDSRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName", pseudoCityOrOfficeMaintenance.GDSCode); //PseudoCityOrOfficeAddresses //Addresses will only display based upon the role of the system user and their Location. PseudoCityOrOfficeAddressRepository pseudoCityOrOfficeAddressRepository = new PseudoCityOrOfficeAddressRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeAddresses = new SelectList(pseudoCityOrOfficeAddressRepository.GetUserPseudoCityOrOfficeAddresses().ToList(), "PseudoCityOrOfficeAddressId", "FirstAddressLine", pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeAddressId); //PseudoCityOrOfficeDefinedRegions PseudoCityOrOfficeDefinedRegionRepository pseudoCityOrOfficeDefinedRegionRepository = new PseudoCityOrOfficeDefinedRegionRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeDefinedRegions = new SelectList( pseudoCityOrOfficeDefinedRegionRepository.GetPseudoCityOrOfficeDefinedRegionsForGlobalRegionCode(pseudoCityOrOfficeMaintenance.GlobalRegionCode).ToList(), "PseudoCityOrOfficeDefinedRegionId", "PseudoCityOrOfficeDefinedRegionName", pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeDefinedRegionId ); //ExternalNames ExternalNameRepository externalNameRepository = new ExternalNameRepository(); pseudoCityOrOfficeMaintenanceVM.ExternalNames = new SelectList(externalNameRepository.GetAllExternalNames().ToList(), "ExternalNameId", "ExternalName1", pseudoCityOrOfficeMaintenance.ExternalNameId); //PseudoCityOrOfficeTypes PseudoCityOrOfficeTypeRepository pseudoCityOrOfficeTypeRepository = new PseudoCityOrOfficeTypeRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeTypes = new SelectList(pseudoCityOrOfficeTypeRepository.GetAllPseudoCityOrOfficeTypes().ToList(), "PseudoCityOrOfficeTypeId", "PseudoCityOrOfficeTypeName", pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeTypeId); //PseudoCityOrOfficeLocationTypes PseudoCityOrOfficeLocationTypeRepository pseudoCityOrOfficeLocationTypeRepository = new PseudoCityOrOfficeLocationTypeRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeLocationTypes = new SelectList(pseudoCityOrOfficeLocationTypeRepository.GetAllPseudoCityOrOfficeLocationTypes().ToList(), "PseudoCityOrOfficeLocationTypeId", "PseudoCityOrOfficeLocationTypeName", pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeLocationTypeId); //FareRedistributions FareRedistributionRepository fareRedistributionRepository = new FareRedistributionRepository(); pseudoCityOrOfficeMaintenanceVM.FareRedistributions = new SelectList( fareRedistributionRepository.GetFareRedistributionsByGDSCode(pseudoCityOrOfficeMaintenance.GDSCode).ToList(), "FareRedistributionId", "FareRedistributionName", pseudoCityOrOfficeMaintenance.FareRedistributionId ); //GDSThirdPartyVendors GDSThirdPartyVendorRepository gdsThirdPartyVendorRepository = new GDSThirdPartyVendorRepository(); pseudoCityOrOfficeMaintenanceVM.GDSThirdPartyVendors = gdsThirdPartyVendorRepository.GetAllGDSThirdPartyVendors(); List <SelectListItem> gdsThirdPartyVendors = new List <SelectListItem>(); foreach (GDSThirdPartyVendor gdsThirdPartyVendor in pseudoCityOrOfficeMaintenanceVM.GDSThirdPartyVendors) { gdsThirdPartyVendors.Add( new SelectListItem { Value = gdsThirdPartyVendor.GDSThirdPartyVendorId.ToString(), Text = gdsThirdPartyVendor.GDSThirdPartyVendorName } ); } List <GDSThirdPartyVendor> selectedGDSThirdPartyVendors = gdsThirdPartyVendorRepository.GetGDSThirdPartyVendorsByPseudoCityOrOfficeMaintenanceId(pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeMaintenanceId); pseudoCityOrOfficeMaintenanceVM.GDSThirdPartyVendorsList = new MultiSelectList( gdsThirdPartyVendors, "Value", "Text", selectedGDSThirdPartyVendors.Select(x => x.GDSThirdPartyVendorId).ToArray() ); //ClientSubUnits pseudoCityOrOfficeMaintenanceVM.ClientSubUnits = pseudoCityOrOfficeMaintenanceRepository.GetAllPseudoCityOrOfficeMaintenanceClientSubUnits(pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeMaintenanceId); //CubaPseudoCityOrOfficeFlagNonNullable //Only a user with the Compliance Administrator for All Clients Globally and a GDS Administrator role (Global or Global Region or Country) can check or uncheck this box ViewData["ComplianceAdministratorAccess"] = ""; if (rolesRepository.PseudoCityOrOfficeMaintenance_CubaPseudoCityOrOfficeFlag()) { ViewData["ComplianceAdministratorAccess"] = "WriteAccess"; } //GovernmentPseudoCityOrOfficeFlagNonNullable //Only a user with the GDS Government Administrator role (Global or Global Region or Country) can check or uncheck this box ViewData["GDSGovernmentAdministratorAccess"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess("GDS Government Administrator")) { ViewData["GDSGovernmentAdministratorAccess"] = "WriteAccess"; } return(View(pseudoCityOrOfficeMaintenanceVM)); }
public ActionResult SystemUserDetailsScreen(string systemUserGuid) { SystemUser systemUser = new SystemUser(); systemUser = systemUserRepository.GetUserBySystemUserGuid(systemUserGuid); //Check Exists if (systemUser == null) { return(PartialView("Error", "System User Does Not Exist")); } //add linked information including location systemUserRepository.EditForDisplay(systemUser); SystemUserWizardVM systemUserWizardViewModel = new SystemUserWizardVM(); SystemUserGDSRepository systemUserGDSRepository = new SystemUserGDSRepository(); List <fnDesktopDataAdmin_SelectSystemUserGDSs_v1Result> systemUserGDSs = new List <fnDesktopDataAdmin_SelectSystemUserGDSs_v1Result>(); systemUserGDSs = systemUserGDSRepository.GetSystemUserGDSs(systemUser.SystemUserGuid).ToList(); GDSRepository gdsRepository = new GDSRepository(); List <GDS> gdss = new List <GDS>(); gdss = gdsRepository.GetAllGDSs().ToList(); SystemUserLocationRepository systemUserLocationRepository = new SystemUserLocationRepository(); SystemUserLocation systemUserLocation = new SystemUserLocation(); systemUserLocation = systemUserLocationRepository.GetSystemUserLocation(systemUser.SystemUserGuid); HierarchyRepository hierarchyRepository = new HierarchyRepository(); //AccessRights if (systemUserLocation != null) { RolesRepository rolesRepository = new RolesRepository(); systemUserWizardViewModel.HasWriteAccessToLocation = rolesRepository.HasWriteAccessToLocation(systemUserLocation.LocationId); } else { systemUserWizardViewModel.HasWriteAccessToLocation = hierarchyRepository.AdminHasDomainWriteAccess("Location"); } //Countries CountryRepository countryRepository = new CountryRepository(); systemUserWizardViewModel.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName"); //ExternalSystemLogins ExternalSystemLoginRepository externalSystemLoginRepository = new ExternalSystemLoginRepository(); List <ExternalSystemLoginSystemUserCountry> externalSystemLoginSystemUserCountries = new List <ExternalSystemLoginSystemUserCountry>(); externalSystemLoginSystemUserCountries = externalSystemLoginRepository.GetBackOfficeIdentifiers(systemUser.SystemUserGuid); foreach (ExternalSystemLoginSystemUserCountry externalSystemLoginSystemUserCountry in externalSystemLoginSystemUserCountries) { externalSystemLoginSystemUserCountry.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", externalSystemLoginSystemUserCountry.CountryCode); } //Check Compliance Access ViewData["ComplianceAdministratorAccess"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess("Compliance Administrator")) { ViewData["ComplianceAdministratorAccess"] = "WriteAccess"; } //Check Restricted System User Access ViewData["RestrictedSystemUserAdministratorAccess"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess("Restricted System User Administrator")) { ViewData["RestrictedSystemUserAdministratorAccess"] = "WriteAccess"; } systemUserWizardViewModel.SystemUser = systemUser; systemUserWizardViewModel.SystemUserGDSs = systemUserGDSs; systemUserWizardViewModel.GDSs = gdss; systemUserWizardViewModel.SystemUserLocation = systemUserLocation; systemUserWizardViewModel.ExternalSystemLoginSystemUserCountries = externalSystemLoginSystemUserCountries; return(PartialView("SystemUserDetailsScreen", systemUserWizardViewModel)); }
// GET: /Create public ActionResult Create() { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } PriceTrackingSetupGroup priceTrackingSetupGroup = new PriceTrackingSetupGroup(); priceTrackingSetupGroup.MidOfficeUsedForQCTicketingFlag = true; TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); ViewData["TripTypes"] = tripTypesList; GDSRepository gdsRepository = new GDSRepository(); SelectList gDSList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gDSList; PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository(); SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName"); ViewData["PNROutputTypes"] = pNROutputTypeList; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); ViewData["HierarchyTypes"] = hierarchyTypesList; PriceTrackingSetupTypeRepository priceTrackingSetupTypeRepository = new PriceTrackingSetupTypeRepository(); SelectList priceTrackingSetupTypes = new SelectList(priceTrackingSetupTypeRepository.GetAllPriceTrackingSetupTypes().ToList(), "PriceTrackingSetupTypeId", "PriceTrackingSetupTypeName"); ViewData["PriceTrackingSetupTypes"] = priceTrackingSetupTypes; DesktopUsedTypeRepository desktopUsedTypeRepository = new DesktopUsedTypeRepository(); SelectList desktopUsedTypes = new SelectList(desktopUsedTypeRepository.GetAllDesktopUsedTypes().ToList(), "DesktopUsedTypeId", "DesktopUsedTypeDescription"); ViewData["DesktopUsedTypes"] = desktopUsedTypes; PriceTrackingMidOfficePlatformRepository priceTrackingMidOfficePlatformRepository = new PriceTrackingMidOfficePlatformRepository(); SelectList priceTrackingMidOfficePlatforms = new SelectList(priceTrackingMidOfficePlatformRepository.GetAllPriceTrackingMidOfficePlatforms().ToList(), "PriceTrackingMidOfficePlatformId", "PriceTrackingMidOfficePlatformName"); ViewData["PriceTrackingMidOfficePlatforms"] = priceTrackingMidOfficePlatforms; ViewData["SharedPseudoCityOrOfficeList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text"); ViewData["MidOfficeUsedForQCTicketingList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", priceTrackingSetupGroup.MidOfficeUsedForQCTicketingFlag); ViewData["USGovernmentContractorList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text"); ViewData["PriceTrackingSetupGroupAdditionalPseudoCityOrOfficeIdList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", "false"); PriceTrackingItinerarySolutionRepository priceTrackingItinerarySolutionRepository = new PriceTrackingItinerarySolutionRepository(); SelectList priceTrackingItinerarySolutions = new SelectList(priceTrackingItinerarySolutionRepository.GetAllPriceTrackingItinerarySolutions().ToList(), "PriceTrackingItinerarySolutionId", "PriceTrackingItinerarySolutionName"); ViewData["PriceTrackingItinerarySolutions"] = priceTrackingItinerarySolutions; PriceTrackingSystemRuleRepository priceTrackingSystemRuleRepository = new PriceTrackingSystemRuleRepository(); SelectList priceTrackingSystemRules = new SelectList(priceTrackingSystemRuleRepository.GetAllPriceTrackingSystemRules().ToList(), "PriceTrackingSystemRuleId", "PriceTrackingSystemRuleName"); ViewData["PriceTrackingSystemRules"] = priceTrackingSystemRules; BackOfficeSystemRepository backOfficeSystemRepository = new BackOfficeSystemRepository(); SelectList backOfficeSystems = new SelectList(backOfficeSystemRepository.GetAllBackOfficeSystems().ToList(), "BackOfficeSytemId", "BackOfficeSystemDescription"); ViewData["BackOfficeSystems"] = backOfficeSystems; PriceTrackingBillingModelRepository priceTrackingBillingModelRepository = new PriceTrackingBillingModelRepository(); List <PriceTrackingBillingModel> priceTrackingBillingModels = priceTrackingBillingModelRepository.GetAllPriceTrackingBillingModels().ToList(); SelectList priceTrackingBillingModelsList = new SelectList(priceTrackingBillingModels, "PriceTrackingBillingModelId", "PriceTrackingBillingModelName"); ViewData["AirPriceTrackingBillingModels"] = priceTrackingBillingModelsList; ViewData["HotelPriceTrackingBillingModels"] = priceTrackingBillingModelsList; ViewData["PreTicketPriceTrackingBillingModels"] = priceTrackingBillingModelsList; return(View(priceTrackingSetupGroup)); }
// GET: /Create public ActionResult Create(int id) { PolicyGroup policyGroup = policyGroupRepository.GetGroup(id); //Check Exists if (policyGroup == null) { ViewData["ActionMethod"] = "CreateGet"; return(View("RecordDoesNotExistError")); } //Check AccessRights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToPolicyGroup(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Populate List of GDSs GDSRepository gdsRepository = new GDSRepository(); SelectList gdss = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSList"] = gdss; //Populate List of PolicySupplierDealCodeTypes PolicySupplierDealCodeTypeRepository policySupplierDealCodeType = new PolicySupplierDealCodeTypeRepository(); SelectList policySupplierDealCodeTypes = new SelectList(policySupplierDealCodeType.GetAllPolicySupplierDealCodeTypes().ToList(), "PolicySupplierDealCodeTypeId", "PolicySupplierDealCodeTypeDescription"); ViewData["PolicySupplierDealCodeTypeList"] = policySupplierDealCodeTypes; //Populate List of Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); ViewData["ProductList"] = products; //Populate List of Policy Locations PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository(); SelectList policyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName"); ViewData["PolicyLocationList"] = policyLocations; //Populate List of Travel Indicators TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); SelectList travelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription"); ViewData["TravelIndicatorList"] = travelIndicators; //Populate Blank List of Tour Code Types (Chosen with GDS Selection) TourCodeTypeRepository tourCodeTypeRepository = new TourCodeTypeRepository(); List <TourCodeType> defaultList = new List <TourCodeType>(); SelectList tourCodeTypes = new SelectList(defaultList, "TourCodeTypeId", "TourCodeTypeDescription"); ViewData["TourCodeTypeList"] = tourCodeTypes; //populate new item with known PolicyGroup Information PolicySupplierDealCode policySupplierDealCode = new PolicySupplierDealCode(); policySupplierDealCode.PolicyGroupId = id; policySupplierDealCode.PolicyGroupName = policyGroup.PolicyGroupName; policySupplierDealCode.EnabledFlagNonNullable = true; //Show 'Create' Form return(View(policySupplierDealCode)); }
// GET: /Edit public ActionResult Edit(int id) { //Get PolicySupplierDealCode PolicySupplierDealCode policySupplierDealCode = new PolicySupplierDealCode(); policySupplierDealCode = policySupplierDealCodeRepository.GetPolicySupplierDealCode(id); //Check Exists if (policySupplierDealCode == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check AccessRights RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToPolicyGroup(policySupplierDealCode.PolicyGroupId)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Populate List of GDSs GDSRepository gdsRepository = new GDSRepository(); SelectList gdss = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSList"] = gdss; //Populate List of Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); ViewData["ProductList"] = products; //Populate List of PolicySupplierDealCodeTypes PolicySupplierDealCodeTypeRepository policySupplierDealCodeType = new PolicySupplierDealCodeTypeRepository(); SelectList policySupplierDealCodeTypes = new SelectList(policySupplierDealCodeType.GetAllPolicySupplierDealCodeTypes().ToList(), "PolicySupplierDealCodeTypeId", "PolicySupplierDealCodeTypeDescription"); ViewData["PolicySupplierDealCodeTypeList"] = policySupplierDealCodeTypes; //Populate List of Policy Locations PolicyLocationRepository policyLocationRepository = new PolicyLocationRepository(); SelectList policyLocations = new SelectList(policyLocationRepository.GetAllPolicyLocations().ToList(), "PolicyLocationId", "PolicyLocationName"); ViewData["PolicyLocationList"] = policyLocations; //Populate List of Travel Indicators TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository(); SelectList travelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().ToList(), "TravelIndicator1", "TravelIndicatorDescription", policySupplierDealCode.TravelIndicator); ViewData["TravelIndicatorList"] = travelIndicators; //Populate List of Tour Code Types TourCodeTypeRepository tourCodeTypeRepository = new TourCodeTypeRepository(); SelectList tourCodeTypes = new SelectList(tourCodeTypeRepository.GetTourCodeTypesForGDS(policySupplierDealCode.GDSCode).ToList(), "TourCodeTypeId", "TourCodeTypeDescription", policySupplierDealCode.TourCodeTypeId); ViewData["TourCodeTypeList"] = tourCodeTypes; //return edit form policySupplierDealCodeRepository.EditItemForDisplay(policySupplierDealCode); return(View(policySupplierDealCode)); }
// GET: /Edit public ActionResult Edit(int id) { //Get Item From Database PriceTrackingSetupGroup group = new PriceTrackingSetupGroup(); group = priceTrackingSetupGroupRepository.GetPriceTrackingSetupGroup(id); //Check Exists if (group == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Access RolesRepository rolesRepository = new RolesRepository(); if (!rolesRepository.HasWriteAccessToPriceTrackingSetupGroup(id)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Set Access Rights ViewData["FIQIDAccess"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess(fIQIDGroupName)) { ViewData["FIQIDAccess"] = "WriteAccess"; } priceTrackingSetupGroupRepository.EditForDisplay(group); TripTypeRepository tripTypeRepository = new TripTypeRepository(); SelectList tripTypesList = new SelectList(tripTypeRepository.GetAllTripTypes().ToList(), "TripTypeId", "TripTypeDescription"); ViewData["tripTypes"] = tripTypesList; GDSRepository gdsRepository = new GDSRepository(); SelectList gDSList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); ViewData["GDSs"] = gDSList; PNROutputTypeRepository pNROutputTypeRepository = new PNROutputTypeRepository(); SelectList pNROutputTypeList = new SelectList(pNROutputTypeRepository.GetAllPNROutputTypes().ToList(), "PNROutputTypeId", "PNROutputTypeName"); ViewData["PNROutputTypes"] = pNROutputTypeList; TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository(); SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName"); ViewData["HierarchyTypes"] = hierarchyTypesList; PriceTrackingSetupTypeRepository priceTrackingSetupTypeRepository = new PriceTrackingSetupTypeRepository(); SelectList priceTrackingSetupTypes = new SelectList(priceTrackingSetupTypeRepository.GetAllPriceTrackingSetupTypes().ToList(), "PriceTrackingSetupTypeId", "PriceTrackingSetupTypeName", group.PriceTrackingSetupTypeId); ViewData["PriceTrackingSetupTypes"] = priceTrackingSetupTypes; DesktopUsedTypeRepository desktopUsedTypeRepository = new DesktopUsedTypeRepository(); SelectList desktopUsedTypes = new SelectList(desktopUsedTypeRepository.GetAllDesktopUsedTypes().ToList(), "DesktopUsedTypeId", "DesktopUsedTypeDescription", group.DesktopUsedTypeId); ViewData["DesktopUsedTypes"] = desktopUsedTypes; PriceTrackingMidOfficePlatformRepository priceTrackingMidOfficePlatformRepository = new PriceTrackingMidOfficePlatformRepository(); SelectList priceTrackingMidOfficePlatforms = new SelectList(priceTrackingMidOfficePlatformRepository.GetAllPriceTrackingMidOfficePlatforms().ToList(), "PriceTrackingMidOfficePlatformId", "PriceTrackingMidOfficePlatformName", group.PriceTrackingMidOfficePlatformId); ViewData["PriceTrackingMidOfficePlatforms"] = priceTrackingMidOfficePlatforms; ViewData["SharedPseudoCityOrOfficeList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.SharedPseudoCityOrOfficeIdFlag); ViewData["MidOfficeUsedForQCTicketingList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.MidOfficeUsedForQCTicketingFlag); ViewData["USGovernmentContractorList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", group.USGovernmentContractorFlag); ViewData["PriceTrackingSetupGroupAdditionalPseudoCityOrOfficeIdList"] = new SelectList(commonRepository.GetTrueFalseList().ToList(), "Value", "Text", "false"); PriceTrackingItinerarySolutionRepository priceTrackingItinerarySolutionRepository = new PriceTrackingItinerarySolutionRepository(); SelectList priceTrackingItinerarySolutions = new SelectList(priceTrackingItinerarySolutionRepository.GetAllPriceTrackingItinerarySolutions().ToList(), "PriceTrackingItinerarySolutionId", "PriceTrackingItinerarySolutionName", group.PriceTrackingItinerarySolutionId); ViewData["PriceTrackingItinerarySolutions"] = priceTrackingItinerarySolutions; PriceTrackingSystemRuleRepository priceTrackingSystemRuleRepository = new PriceTrackingSystemRuleRepository(); SelectList priceTrackingSystemRules = new SelectList(priceTrackingSystemRuleRepository.GetAllPriceTrackingSystemRules().ToList(), "PriceTrackingSystemRuleId", "PriceTrackingSystemRuleName", group.PriceTrackingSystemRuleId); ViewData["PriceTrackingSystemRules"] = priceTrackingSystemRules; BackOfficeSystemRepository backOfficeSystemRepository = new BackOfficeSystemRepository(); SelectList backOfficeSystems = new SelectList(backOfficeSystemRepository.GetAllBackOfficeSystems().ToList(), "BackOfficeSytemId", "BackOfficeSystemDescription", group.BackOfficeSystemId); ViewData["BackOfficeSystems"] = backOfficeSystems; PriceTrackingBillingModelRepository priceTrackingBillingModelRepository = new PriceTrackingBillingModelRepository(); List <PriceTrackingBillingModel> priceTrackingBillingModels = priceTrackingBillingModelRepository.GetAllPriceTrackingBillingModels().ToList(); SelectList airPriceTrackingBillingModels = new SelectList(priceTrackingBillingModels, "PriceTrackingBillingModelId", "PriceTrackingBillingModelName", group.AirPriceTrackingBillingModelId); ViewData["AirPriceTrackingBillingModels"] = airPriceTrackingBillingModels; SelectList hotelPriceTrackingBillingModels = new SelectList(priceTrackingBillingModels, "PriceTrackingBillingModelId", "PriceTrackingBillingModelName", group.HotelPriceTrackingBillingModelId); ViewData["HotelPriceTrackingBillingModels"] = hotelPriceTrackingBillingModels; SelectList preTicketPriceTrackingBillingModels = new SelectList(priceTrackingBillingModels, "PriceTrackingBillingModelId", "PriceTrackingBillingModelName", group.PreTicketPriceTrackingBillingModelId); ViewData["PreTicketPriceTrackingBillingModels"] = preTicketPriceTrackingBillingModels; return(View(group)); }
// GET: /Edit public ActionResult Edit(int id) { //Get Item GDSOrder gdsOrder = new GDSOrder(); gdsOrder = gdsOrderRepository.GetGDSOrder(id); //Check Exists if (gdsOrder == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //AccessRights RolesRepository rolesRepository = new RolesRepository(); if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } //Empty list for dropdowns populated by Ajax List <SelectListItem> blankList = new List <SelectListItem>(); GDSOrderVM GDSOrderVM = new GDSOrderVM(); //Order Analyst GDSOrderAnalyst gdsOrderAnalyst = gdsOrderRepository.GetGDSOrderAnalyst(); if (gdsOrderAnalyst != null) { gdsOrder.OrderAnalystName = gdsOrderAnalyst.FirstName + " " + gdsOrderAnalyst.LastName; gdsOrder.OrderAnalystEmail = gdsOrderAnalyst.Email; gdsOrder.OrderAnalystPhone = gdsOrderAnalyst.Phone; gdsOrder.OrderAnalystCountryCode = gdsOrderAnalyst.CountryCode; } gdsOrderRepository.EditForDisplay(gdsOrder); PseudoCityOrOfficeMaintenanceRepository pseudoCityOrOfficeMaintenanceRepository = new PseudoCityOrOfficeMaintenanceRepository(); pseudoCityOrOfficeMaintenanceRepository.EditForDisplay(gdsOrder.PseudoCityOrOfficeMaintenance); GDSOrderVM.GDSOrder = gdsOrder; //Select Lists GDSOrderVM.OrderAnalystCountries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", gdsOrder.OrderAnalystCountryCode); GDSOrderVM.RequesterCountries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", gdsOrder.RequesterCountryCode); GDSOrderVM.GDSs = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName", gdsOrder.GDSCode); GDSOrderVM.GDSOrderTypes = new SelectList(gdsOrderTypeRepository.GetAllGDSOrderTypes().ToList(), "GDSOrderTypeId", "GDSOrderTypeName", gdsOrder.GDSOrderTypeId); GDSOrderVM.GDSOrderStatuses = new SelectList(gdsOrderStatusRepository.GetAllGDSOrderStatuses().ToList(), "GDSOrderStatusId", "GDSOrderStatusName", gdsOrder.GDSOrderStatusId); GDSOrderVM.PseudoCityOrOfficeAddresses = new SelectList(pseudoCityOrOfficeAddressRepository.GetUserPseudoCityOrOfficeAddresses().ToList(), "PseudoCityOrOfficeAddressId", "FirstAddressLine"); GDSOrderVM.GDSOrderLineItemActions = new SelectList(gdsOrderLineItemActionRepository.GetAllGDSOrderLineItemActions().ToList(), "GDSOrderLineItemActionId", "GDSOrderLineItemActionName"); //ThirdPartyVendors GDSThirdPartyVendorRepository gdsThirdPartyVendorRepository = new GDSThirdPartyVendorRepository(); GDSOrderVM.GDSThirdPartyVendors = gdsThirdPartyVendorRepository.GetAllGDSThirdPartyVendors(); List <SelectListItem> gdsThirdPartyVendors = new List <SelectListItem>(); foreach (GDSThirdPartyVendor gdsThirdPartyVendor in GDSOrderVM.GDSThirdPartyVendors) { gdsThirdPartyVendors.Add( new SelectListItem { Value = gdsThirdPartyVendor.GDSThirdPartyVendorId.ToString(), Text = gdsThirdPartyVendor.GDSThirdPartyVendorName.ToString() } ); } //GDS Order - ThirdPartyVendors List <GDSThirdPartyVendor> selectedGDSThirdPartyVendors = gdsOrderRepository.GetGDSOrderThirdPartyVendors(gdsOrder.GDSOrderId); GDSOrderVM.GDSThirdPartyVendorsList = new MultiSelectList( gdsThirdPartyVendors, "Value", "Text", selectedGDSThirdPartyVendors.Select(x => x.GDSThirdPartyVendorId).ToArray() ); //IATAs IATARepository iataRepository = new IATARepository(); GDSOrderVM.IATAs = new SelectList(iataRepository.GetAllIATAs().ToList(), "IATAId", "IATANumber"); //GDSs GDSRepository GDSRepository = new GDSRepository(); GDSOrderVM.GDSs = new SelectList(GDSRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); //PseudoCityOrOfficeDefinedRegions PseudoCityOrOfficeDefinedRegionRepository pseudoCityOrOfficeDefinedRegionRepository = new PseudoCityOrOfficeDefinedRegionRepository(); GDSOrderVM.PseudoCityOrOfficeDefinedRegions = new SelectList( pseudoCityOrOfficeDefinedRegionRepository.GetPseudoCityOrOfficeDefinedRegionsForGlobalRegionCode(gdsOrder.PseudoCityOrOfficeMaintenance.GlobalRegionCode), "PseudoCityOrOfficeDefinedRegionId", "PseudoCityOrOfficeDefinedRegionName", gdsOrder.PseudoCityOrOfficeMaintenance.PseudoCityOrOfficeDefinedRegionId ); //ExternalNames ExternalNameRepository externalNameRepository = new ExternalNameRepository(); GDSOrderVM.ExternalNames = new SelectList(externalNameRepository.GetAllExternalNames().ToList(), "ExternalNameId", "ExternalName1"); //PseudoCityOrOfficeTypes PseudoCityOrOfficeTypeRepository pseudoCityOrOfficeTypeRepository = new PseudoCityOrOfficeTypeRepository(); GDSOrderVM.PseudoCityOrOfficeTypes = new SelectList(pseudoCityOrOfficeTypeRepository.GetAllPseudoCityOrOfficeTypes().ToList(), "PseudoCityOrOfficeTypeId", "PseudoCityOrOfficeTypeName"); //PseudoCityOrOfficeLocationTypes PseudoCityOrOfficeLocationTypeRepository pseudoCityOrOfficeLocationTypeRepository = new PseudoCityOrOfficeLocationTypeRepository(); GDSOrderVM.PseudoCityOrOfficeLocationTypes = new SelectList(pseudoCityOrOfficeLocationTypeRepository.GetAllPseudoCityOrOfficeLocationTypes().ToList(), "PseudoCityOrOfficeLocationTypeId", "PseudoCityOrOfficeLocationTypeName"); //FareRedistributions FareRedistributionRepository fareRedistributionRepository = new FareRedistributionRepository(); GDSOrderVM.FareRedistributions = new SelectList( fareRedistributionRepository.GetFareRedistributionsByGDSCode(gdsOrder.PseudoCityOrOfficeMaintenance.GDSCode), "FareRedistributionId", "FareRedistributionName", gdsOrder.PseudoCityOrOfficeMaintenance.FareRedistributionId ); //CubaPseudoCityOrOfficeFlagNonNullable //Only a user with the Compliance Administrator for All Clients Globally and a GDS Administrator role (Global or Global Region or Country) can check or uncheck this box ViewData["ComplianceAdministratorAccess"] = ""; if (rolesRepository.PseudoCityOrOfficeMaintenance_CubaPseudoCityOrOfficeFlag()) { ViewData["ComplianceAdministratorAccess"] = "WriteAccess"; } //GovernmentPseudoCityOrOfficeFlagNonNullable //Only a user with the GDS Government Administrator role (Global or Global Region or Country) can check or uncheck this box ViewData["GDSGovernmentAdministratorAccess"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess("GDS Government Administrator")) { ViewData["GDSGovernmentAdministratorAccess"] = "WriteAccess"; } //PseudoCityOrOfficeMaintenance GDSThirdPartyVendors List <GDSThirdPartyVendor> selectedPseudoCityOrOfficeMaintenanceGDSThirdPartyVendors = gdsThirdPartyVendorRepository.GetGDSThirdPartyVendorsByPseudoCityOrOfficeMaintenanceId( gdsOrder.PseudoCityOrOfficeMaintenance.PseudoCityOrOfficeMaintenanceId ); GDSOrderVM.PseudoCityOrOfficeMaintenanceGDSThirdPartyVendorsList = new MultiSelectList( gdsThirdPartyVendors, "Value", "Text", selectedPseudoCityOrOfficeMaintenanceGDSThirdPartyVendors.Select(x => x.GDSThirdPartyVendorId).ToArray() ); return(View(GDSOrderVM)); }
// GET: /List public ActionResult List( string filter, int?page, string sortField, int?sortOrder, int?gdsOrderId = null, int?gdsOrderStatusId = null, string ticketNumber = null, string pseudoCityOrOfficeId = "", int?gdsOrderTypeId = null, DateTime?gdsOrderDateTimeStart = null, DateTime?gdsOrderDateTimeEnd = null, string orderAnalyst = "", string internalSiteName = "", string gdsCode = "") { //Set Access Rights ViewData["Access"] = ""; RolesRepository rolesRepository = new RolesRepository(); if (hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Access"] = "WriteAccess"; } //SortField if (string.IsNullOrEmpty(sortField)) { sortField = "GDSOrderId"; } ViewData["CurrentSortField"] = sortField; //SortOrder if (sortOrder == 1) { ViewData["NewSortOrder"] = 0; ViewData["CurrentSortOrder"] = 1; } else { ViewData["NewSortOrder"] = 1; ViewData["CurrentSortOrder"] = 0; } //Default Filters ViewData["GDSOrderId"] = gdsOrderId ?? null; ViewData["GDSOrderStatusId"] = gdsOrderStatusId ?? null; ViewData["TicketNumber"] = ticketNumber ?? ""; ViewData["PseudoCityOrOfficeId"] = pseudoCityOrOfficeId ?? null; ViewData["GDSOrderTypeId"] = gdsOrderTypeId ?? null; ViewData["GDSOrderDateTimeStart"] = gdsOrderDateTimeStart ?? null; ViewData["GDSOrderDateTimeEnd"] = gdsOrderDateTimeEnd ?? null; ViewData["OrderAnalyst"] = orderAnalyst ?? ""; ViewData["InternalSiteName"] = internalSiteName ?? ""; ViewData["GDSCode"] = gdsCode ?? ""; ViewData["Analysts"] = new SelectList(gdsOrderRepository.GetAllGDSOrderAnalysts().ToList().OrderBy(x => x.Value), "Key", "Value", orderAnalyst); ViewData["GDSs"] = new SelectList(gdsRepository.GetAllGDSs().ToDictionary(x => x.GDSCode, x => x.GDSName).OrderBy(x => x.Value), "Key", "Value", gdsCode); ViewData["OrderStatuses"] = new SelectList(gdsOrderStatusRepository.GetAllGDSOrderStatuses().ToDictionary(x => x.GDSOrderStatusId, x => x.GDSOrderStatusName).OrderBy(x => x.Value), "Key", "Value", gdsOrderStatusId); ViewData["OrderTypes"] = new SelectList(gdsOrderTypeRepository.GetAllGDSOrderTypes().ToDictionary(x => x.GDSOrderTypeId, x => x.GDSOrderTypeName).OrderBy(x => x.Value), "Key", "Value", gdsOrderTypeId); //return items var cwtPaginatedList = gdsOrderRepository.PageGDSOrders( page ?? 1, filter ?? "", sortField, sortOrder ?? 0, gdsOrderId ?? null, gdsOrderStatusId ?? null, ticketNumber ?? "", pseudoCityOrOfficeId ?? "", gdsOrderTypeId ?? null, gdsOrderDateTimeStart ?? null, gdsOrderDateTimeEnd ?? null, orderAnalyst ?? "", internalSiteName ?? "", gdsCode ?? "" ); return(View(cwtPaginatedList)); }
// GET: /ServiceFund/Edit public ActionResult Edit(int id) { //Get Item From Database ServiceFund serviceFund = new ServiceFund(); serviceFund = serviceFundRepository.GetServiceFund(id); //Check Exists if (serviceFund == null) { ViewData["ActionMethod"] = "EditGet"; return(View("RecordDoesNotExistError")); } //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ServiceFundVM serviceFundVM = new ServiceFundVM(); serviceFundVM.ServiceFund = serviceFund; //GDSs GDSRepository gdsRepository = new GDSRepository(); SelectList gdsList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName", serviceFund.GDSCode); serviceFundVM.GDSs = gdsList; //Countries CountryRepository countryRepository = new CountryRepository(); SelectList countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", serviceFund.PCCCountryCode); serviceFundVM.Countries = countries; //Fund Use Statuses FundUseStatusRepository fundUseStatusRepository = new FundUseStatusRepository(); SelectList fundUseStatusList = new SelectList(fundUseStatusRepository.GetAllFundUseStatuses().ToList(), "Key", "Value", serviceFund.FundUseStatus); serviceFundVM.FundUseStatuses = fundUseStatusList; //TimeZoneRules TimeZoneRuleRepository timeZoneRuleRepository = new TimeZoneRuleRepository(); SelectList timeZoneRules = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc", serviceFund.TimeZoneRuleCode); serviceFundVM.TimeZoneRules = timeZoneRules; //Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName", serviceFund.ProductId); serviceFundVM.Products = products; //Suppliers SupplierRepository supplierRepository = new SupplierRepository(); SelectList suppliers = new SelectList(supplierRepository.GetAllSuppliers().ToList(), "SupplierCode", "SupplierName", serviceFund.SupplierName); serviceFundVM.Suppliers = suppliers; //Currencies CurrencyRepository currencyRepository = new CurrencyRepository(); SelectList currencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name", serviceFund.ServiceFundCurrencyCode); serviceFundVM.Currencies = currencies; //Service Fund Routings ServiceFundRoutingRepository serviceFundRoutingRepository = new ServiceFundRoutingRepository(); SelectList serviceFundRoutingsList = new SelectList(serviceFundRoutingRepository.GetAllServiceFundRoutings().ToList(), "Key", "Value", serviceFund.ServiceFundRouting); serviceFundVM.ServiceFundRoutings = serviceFundRoutingsList; //ServiceFundChannelTypes ServiceFundChannelTypeRepository serviceFundChannelTypeRepository = new ServiceFundChannelTypeRepository(); SelectList serviceFundChannelTypesList = new SelectList(serviceFundChannelTypeRepository.GetAllServiceFundChannelTypes().ToList(), "ServiceFundChannelTypeId", "ServiceFundChannelTypeName", serviceFund.ServiceFundChannelTypeId); serviceFundVM.ServiceFundChannelTypes = serviceFundChannelTypesList; serviceFundRepository.EditGroupForDisplay(serviceFund); return(View(serviceFundVM)); }
public ActionResult Create() { //Set Access Rights ViewData["Access"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Access"] = "WriteAccess"; } PseudoCityOrOfficeMaintenanceVM pseudoCityOrOfficeMaintenanceVM = new PseudoCityOrOfficeMaintenanceVM(); PseudoCityOrOfficeMaintenance pseudoCityOrOfficeMaintenance = new PseudoCityOrOfficeMaintenance(); //Checkboxes pseudoCityOrOfficeMaintenance.ActiveFlagNonNullable = true; pseudoCityOrOfficeMaintenance.SharedPseudoCityOrOfficeFlagNonNullable = false; pseudoCityOrOfficeMaintenance.CWTOwnedPseudoCityOrOfficeFlagNonNullable = false; pseudoCityOrOfficeMaintenance.ClientDedicatedPseudoCityOrOfficeFlagNonNullable = false; pseudoCityOrOfficeMaintenance.ClientGDSAccessFlagNonNullable = false; pseudoCityOrOfficeMaintenance.DevelopmentOrInternalPseudoCityOrOfficeFlagNonNullable = false; pseudoCityOrOfficeMaintenance.CubaPseudoCityOrOfficeFlagNonNullable = false; pseudoCityOrOfficeMaintenance.GovernmentPseudoCityOrOfficeFlagNonNullable = false; pseudoCityOrOfficeMaintenance.GDSThirdPartyVendorFlagNonNullable = false; pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeMaintenance = pseudoCityOrOfficeMaintenance; //Created as dropdowns are using Ajax List <SelectListItem> blankList = new List <SelectListItem>(); //IATAs IATARepository iataRepository = new IATARepository(); pseudoCityOrOfficeMaintenanceVM.IATAs = new SelectList(iataRepository.GetAllIATAs().ToList(), "IATAId", "IATANumber"); //GDSs GDSRepository GDSRepository = new GDSRepository(); pseudoCityOrOfficeMaintenanceVM.GDSs = new SelectList(GDSRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); //PseudoCityOrOfficeAddresses //Addresses will only display based upon the role of the system user and their Location. PseudoCityOrOfficeAddressRepository pseudoCityOrOfficeAddressRepository = new PseudoCityOrOfficeAddressRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeAddresses = new SelectList(pseudoCityOrOfficeAddressRepository.GetUserPseudoCityOrOfficeAddresses().ToList(), "PseudoCityOrOfficeAddressId", "FirstAddressLine"); //PseudoCityOrOfficeDefinedRegions PseudoCityOrOfficeDefinedRegionRepository pseudoCityOrOfficeDefinedRegionRepository = new PseudoCityOrOfficeDefinedRegionRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeDefinedRegions = new SelectList(blankList, "PseudoCityOrOfficeDefinedRegionId", "PseudoCityOrOfficeDefinedRegionName"); //ExternalNames ExternalNameRepository externalNameRepository = new ExternalNameRepository(); pseudoCityOrOfficeMaintenanceVM.ExternalNames = new SelectList(externalNameRepository.GetAllExternalNames().ToList(), "ExternalNameId", "ExternalName1"); //PseudoCityOrOfficeTypes PseudoCityOrOfficeTypeRepository pseudoCityOrOfficeTypeRepository = new PseudoCityOrOfficeTypeRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeTypes = new SelectList(pseudoCityOrOfficeTypeRepository.GetAllPseudoCityOrOfficeTypes().ToList(), "PseudoCityOrOfficeTypeId", "PseudoCityOrOfficeTypeName"); //PseudoCityOrOfficeLocationTypes PseudoCityOrOfficeLocationTypeRepository pseudoCityOrOfficeLocationTypeRepository = new PseudoCityOrOfficeLocationTypeRepository(); pseudoCityOrOfficeMaintenanceVM.PseudoCityOrOfficeLocationTypes = new SelectList(pseudoCityOrOfficeLocationTypeRepository.GetAllPseudoCityOrOfficeLocationTypes().ToList(), "PseudoCityOrOfficeLocationTypeId", "PseudoCityOrOfficeLocationTypeName"); //FareRedistributions FareRedistributionRepository fareRedistributionRepository = new FareRedistributionRepository(); pseudoCityOrOfficeMaintenanceVM.FareRedistributions = new SelectList(blankList, "FareRedistributionId", "FareRedistributionName"); //GDSThirdPartyVendors GDSThirdPartyVendorRepository gdsThirdPartyVendorRepository = new GDSThirdPartyVendorRepository(); pseudoCityOrOfficeMaintenanceVM.GDSThirdPartyVendors = gdsThirdPartyVendorRepository.GetAllGDSThirdPartyVendors(); List <SelectListItem> gdsThirdPartyVendors = new List <SelectListItem>(); foreach (GDSThirdPartyVendor gdsThirdPartyVendor in pseudoCityOrOfficeMaintenanceVM.GDSThirdPartyVendors) { gdsThirdPartyVendors.Add( new SelectListItem { Value = gdsThirdPartyVendor.GDSThirdPartyVendorId.ToString(), Text = gdsThirdPartyVendor.GDSThirdPartyVendorName } ); } List <GDSThirdPartyVendor> selectedGDSThirdPartyVendors = gdsThirdPartyVendorRepository.GetGDSThirdPartyVendorsByPseudoCityOrOfficeMaintenanceId(pseudoCityOrOfficeMaintenance.PseudoCityOrOfficeMaintenanceId); pseudoCityOrOfficeMaintenanceVM.GDSThirdPartyVendorsList = new MultiSelectList( gdsThirdPartyVendors, "Value", "Text" ); //CubaPseudoCityOrOfficeFlagNonNullable //Only a user with the Compliance Administrator for All Clients Globally and a GDS Administrator role (Global or Global Region or Country) can check or uncheck this box ViewData["ComplianceAdministratorAccess"] = ""; if (rolesRepository.PseudoCityOrOfficeMaintenance_CubaPseudoCityOrOfficeFlag()) { ViewData["ComplianceAdministratorAccess"] = "WriteAccess"; } //GovernmentPseudoCityOrOfficeFlagNonNullable //Only a user with the GDS Government Administrator role (Global or Global Region or Country) can check or uncheck this box ViewData["GDSGovernmentAdministratorAccess"] = ""; if (hierarchyRepository.AdminHasDomainWriteAccess("GDS Government Administrator")) { ViewData["GDSGovernmentAdministratorAccess"] = "WriteAccess"; } return(View(pseudoCityOrOfficeMaintenanceVM)); }
// // GET: /ServiceFund/Create public ActionResult Create() { //Check Access Rights to Domain if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName)) { ViewData["Message"] = "You do not have access to this item"; return(View("Error")); } ServiceFundVM serviceFundVM = new ServiceFundVM(); ServiceFund serviceFund = new ServiceFund(); serviceFundVM.ServiceFund = serviceFund; //GDSs GDSRepository gdsRepository = new GDSRepository(); SelectList gdsList = new SelectList(gdsRepository.GetAllGDSs().ToList(), "GDSCode", "GDSName"); serviceFundVM.GDSs = gdsList; //Countries CountryRepository countryRepository = new CountryRepository(); SelectList countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName"); serviceFundVM.Countries = countries; //Fund Use Statuses FundUseStatusRepository fundUseStatusRepository = new FundUseStatusRepository(); SelectList fundUseStatusList = new SelectList(fundUseStatusRepository.GetAllFundUseStatuses().ToList(), "Key", "Value"); serviceFundVM.FundUseStatuses = fundUseStatusList; //TimeZoneRules TimeZoneRuleRepository timeZoneRuleRepository = new TimeZoneRuleRepository(); SelectList timeZoneRules = new SelectList(timeZoneRuleRepository.GetAllTimeZoneRules().ToList(), "TimeZoneRuleCode", "TimeZoneRuleCodeDesc", "CST/CDT"); serviceFundVM.TimeZoneRules = timeZoneRules; //Products ProductRepository productRepository = new ProductRepository(); SelectList products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName"); serviceFundVM.Products = products; //Suppliers SupplierRepository supplierRepository = new SupplierRepository(); SelectList suppliers = new SelectList(supplierRepository.GetAllSuppliers().ToList(), "SupplierCode", "SupplierName"); serviceFundVM.Suppliers = suppliers; //Currencies CurrencyRepository currencyRepository = new CurrencyRepository(); SelectList currencies = new SelectList(currencyRepository.GetAllCurrencies().ToList(), "CurrencyCode", "Name"); serviceFundVM.Currencies = currencies; //Service Fund Routings ServiceFundRoutingRepository serviceFundRoutingRepository = new ServiceFundRoutingRepository(); SelectList serviceFundRoutingsList = new SelectList(serviceFundRoutingRepository.GetAllServiceFundRoutings().ToList(), "Key", "Value"); serviceFundVM.ServiceFundRoutings = serviceFundRoutingsList; //ServiceFundChannelTypes ServiceFundChannelTypeRepository serviceFundChannelTypeRepository = new ServiceFundChannelTypeRepository(); SelectList serviceFundChannelTypesList = new SelectList(serviceFundChannelTypeRepository.GetAllServiceFundChannelTypes().ToList(), "ServiceFundChannelTypeId", "ServiceFundChannelTypeName"); serviceFundVM.ServiceFundChannelTypes = serviceFundChannelTypesList; return(View(serviceFundVM)); }