// 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));
        }
Ejemplo n.º 2
0
        //
        // GET: /ClientProfileGroup/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"));
            }

            ClientProfileGroupVM clientProfileGroupVM = new ClientProfileGroupVM();

            //GDS List
            GDSRepository gDSRepository = new GDSRepository();
            SelectList    gDSs          = new SelectList(gDSRepository.GetClientProfileBuilderGDSs().ToList(), "GDSCode", "GDSName");

            clientProfileGroupVM.GDSs = gDSs;

            //BackOfficeSystem List removing 'All' option
            BackOfficeSystemRepository backOfficeSystemRepository = new BackOfficeSystemRepository();
            SelectList backOffices = new SelectList(backOfficeSystemRepository.GetAllBackOfficeSystems().ToList(), "BackOfficeSytemId", "BackOfficeSystemDescription");

            clientProfileGroupVM.BackOffices = backOffices;

            //Hierarchy List
            TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository();
            SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName");

            clientProfileGroupVM.HierarchyTypes = hierarchyTypesList;

            ClientProfileGroup ClientProfileGroup = new ClientProfileGroup();

            clientProfileGroupVM.ClientProfileGroup = ClientProfileGroup;

            return(View(clientProfileGroupVM));
        }
        // 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
        public ActionResult Create(int id)
        {
            Meeting meeting = new Meeting();

            meeting = meetingRepository.GetGroup(id);

            //Check Exists
            if (meeting == null)
            {
                ViewData["ActionMethod"] = "CreateGet";
                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"));
            }

            MeetingPNROutputVM meetingPNROutputVM = new MeetingPNROutputVM();

            MeetingPNROutput meetingPNROutput = new MeetingPNROutput();

            meetingPNROutputVM.MeetingPNROutput = meetingPNROutput;

            meetingRepository.EditGroupForDisplay(meeting);

            ViewData["ClientTopUnitGuid"] = meeting.ClientTopUnitGuid;
            ViewData["ClientTopUnitName"] = meeting.ClientTopUnit.ClientTopUnitName;
            ViewData["MeetingID"]         = meeting.MeetingID;
            ViewData["MeetingName"]       = meeting.MeetingName;

            meetingPNROutputVM.Meeting = meeting;
            meetingPNROutput.MeetingID = meeting.MeetingID;

            //GDS
            GDSRepository GDSRepository = new GDSRepository();

            meetingPNROutputVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName");

            //PNR Output Remark Types
            PNROutputRemarkTypeRepository PNROutputRemarkTypeRepository = new PNROutputRemarkTypeRepository();

            meetingPNROutputVM.PNROutputRemarkTypeCodes = new SelectList(PNROutputRemarkTypeRepository.GetMeetingPNROutputRemarkTypes(), "PNROutputRemarkTypeCode", "PNROutputRemarkTypeName", "");

            //Languages
            LanguageRepository languageRepository = new LanguageRepository();

            meetingPNROutputVM.Languages = new SelectList(languageRepository.GetAllLanguages().ToList(), "LanguageCode", "LanguageName");

            //Countries
            CountryRepository countryRepository = new CountryRepository();

            meetingPNROutputVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName");

            return(View(meetingPNROutputVM));
        }
        // GET: /GDSEndWarningConfiguration/Edit
        public ActionResult Edit(int id)
        {
            //Get Item From Database
            GDSEndWarningConfiguration gdsEndWarningConfiguration = new GDSEndWarningConfiguration();

            gdsEndWarningConfiguration = gdsEndWarningConfigurationRepository.GetGroup(id);

            //Check Exists
            if (gdsEndWarningConfiguration == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }
            //Check Access
            if (!rolesRepository.HasWriteAccessToGDSEndWarningConfiguration())
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            GDSEndWarningConfigurationVM gdsEndWarningConfigurationVM = new GDSEndWarningConfigurationVM();

            gdsEndWarningConfigurationVM.GDSEndWarningConfiguration = gdsEndWarningConfiguration;

            //GDS List
            GDSRepository gDSRepository = new GDSRepository();
            SelectList    gDSs          = new SelectList(gDSRepository.GetClientProfileBuilderGDSs().ToList(), "GDSCode", "GDSName", gdsEndWarningConfiguration.GDSCode);

            gdsEndWarningConfigurationVM.GDSs = gDSs;

            //GDSEndWarningBehaviorTypes
            GDSEndWarningBehaviorTypeRepository gdsEndWarningBehaviorTypeRepository = new GDSEndWarningBehaviorTypeRepository();
            SelectList gdsEndWarningBehaviorTypes = new SelectList(gdsEndWarningBehaviorTypeRepository.GetAllGDSEndWarningBehaviorTypes().ToList(), "GDSEndWarningBehaviorTypeId", "GDSEndWarningBehaviorTypeDescription", gdsEndWarningConfiguration.GDSEndWarningBehaviorTypeId);

            gdsEndWarningConfigurationVM.GDSEndWarningBehaviorTypes = gdsEndWarningBehaviorTypes;

            //Automated Commands
            if (gdsEndWarningConfigurationVM.GDSEndWarningConfiguration.AutomatedCommands == null ||
                (gdsEndWarningConfigurationVM.GDSEndWarningConfiguration.AutomatedCommands != null && gdsEndWarningConfigurationVM.GDSEndWarningConfiguration.AutomatedCommands.Count < 1))
            {
                List <AutomatedCommand> automatedCommands = new List <AutomatedCommand>();
                AutomatedCommand        automatedCommand  = new AutomatedCommand()
                {
                    CommandExecutionSequenceNumber = 1
                };
                automatedCommands.Add(automatedCommand);
                ViewData["AutomatedCommands"] = automatedCommands;
            }
            else
            {
                ViewData["AutomatedCommands"] = gdsEndWarningConfigurationVM.GDSEndWarningConfiguration.AutomatedCommands;
            }

            ViewData["WarningMessage"] = gdsEndWarningConfiguration.IdentifyingWarningMessage;

            return(View(gdsEndWarningConfigurationVM));
        }
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            MeetingPNROutputVM meetingPNROutputVM = new MeetingPNROutputVM();

            MeetingPNROutput meetingPNROutput = new MeetingPNROutput();

            meetingPNROutput = meetingPNROutputRepository.GetMeetingPNROutput(id);
            if (meetingPNROutput == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return(View("RecordDoesNotExistError"));
            }

            meetingPNROutputVM.MeetingPNROutput = meetingPNROutput;

            //Check Exists Meeting for VM
            Meeting meeting = new Meeting();

            meeting = meetingRepository.GetGroup(meetingPNROutput.MeetingID);
            if (meeting != null)
            {
                meetingRepository.EditGroupForDisplay(meeting);
                meetingPNROutputVM.Meeting = meeting;
            }

            meetingRepository.EditGroupForDisplay(meeting);

            ViewData["ClientTopUnitGuid"] = meeting.ClientTopUnitGuid;
            ViewData["ClientTopUnitName"] = meeting.ClientTopUnit.ClientTopUnitName;
            ViewData["MeetingID"]         = meeting.MeetingID;
            ViewData["MeetingName"]       = meeting.MeetingName;

            meetingPNROutputVM.Meeting = meeting;
            meetingPNROutput.MeetingID = meeting.MeetingID;

            //GDS
            GDSRepository GDSRepository = new GDSRepository();

            meetingPNROutputVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName", meetingPNROutput.GDSCode);

            //PNR Output Remark Types
            PNROutputRemarkTypeRepository PNROutputRemarkTypeRepository = new PNROutputRemarkTypeRepository();

            meetingPNROutputVM.PNROutputRemarkTypeCodes = new SelectList(PNROutputRemarkTypeRepository.GetMeetingPNROutputRemarkTypes(), "PNROutputRemarkTypeCode", "PNROutputRemarkTypeName", meetingPNROutput.PNROutputRemarkTypeCode);

            //Languages
            LanguageRepository languageRepository = new LanguageRepository();

            meetingPNROutputVM.Languages = new SelectList(languageRepository.GetAllLanguages().ToList(), "LanguageCode", "LanguageName", meetingPNROutput.DefaultLanguageCode);

            //Countries
            CountryRepository countryRepository = new CountryRepository();

            meetingPNROutputVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", meetingPNROutput.CountryCode);

            return(View(meetingPNROutputVM));
        }
        // 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));
        }
Ejemplo n.º 8
0
        // 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: /ClientProfileAdminGroup/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"));
            }

            ClientProfileAdminGroupVM clientProfileAdminGroupVM = new ClientProfileAdminGroupVM();

            //GDS List
            GDSRepository gDSRepository = new GDSRepository();
            SelectList    gDSs          = new SelectList(gDSRepository.GetClientProfileBuilderGDSs().ToList(), "GDSCode", "GDSName");

            clientProfileAdminGroupVM.GDSs = gDSs;

            //BackOfficeSystem List

            //Only show All option if user has a global role
            string adminUserGuid = System.Web.HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0];

            //if adminUserGuid is global
            RolesRepository            rolesRepository            = new RolesRepository();
            BackOfficeSystemRepository backOfficeSystemRepository = new BackOfficeSystemRepository();

            if (rolesRepository.HasWriteAccessToGroupHierarchyLevel(groupName, "Global"))
            {
                SelectList backOffices = new SelectList(backOfficeSystemRepository.GetAllBackOfficeSystems().ToList(), "BackOfficeSytemId", "BackOfficeSystemDescription");
                clientProfileAdminGroupVM.BackOffices = backOffices;
            }
            else
            {
                SelectList backOffices = new SelectList(backOfficeSystemRepository.GetBackOfficeSystemsExceptAll().ToList(), "BackOfficeSytemId", "BackOfficeSystemDescription");
                clientProfileAdminGroupVM.BackOffices = backOffices;
            }


            //Hierarchy List
            TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository();
            SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName");

            clientProfileAdminGroupVM.HierarchyTypes = hierarchyTypesList;

            ClientProfileAdminGroup clientProfileAdminGroup = new ClientProfileAdminGroup();

            clientProfileAdminGroupVM.ClientProfileAdminGroup = clientProfileAdminGroup;

            return(View(clientProfileAdminGroupVM));
        }
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            ServicingOptionItem servicingOptionItem = new ServicingOptionItem();

            servicingOptionItem = servicingOptionItemRepository.GetItem(id);

            //Check Exists
            if (servicingOptionItem == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }
            //AccessRights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToServicingOptionGroup(servicingOptionItem.ServicingOptionGroupId))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            ServicingOptionRepository servicingOptionRepository = new ServicingOptionRepository();
            SelectList servicingOptionsList = new SelectList(servicingOptionRepository.GetAllServicingOptions().ToList(), "ServicingOptionId", "ServicingOptionName");

            ViewData["ServicingOptions"] = servicingOptionsList;

            GDSRepository gdsRepository = new GDSRepository();
            SelectList    gDSList       = new SelectList(gdsRepository.GetAllGDSsExceptALL().ToList(), "GDSCode", "GDSName");

            ViewData["GDSs"] = gDSList;

            ViewData["DepartureTimeWindowMinutesList"] = new SelectList(
                servicingOptionRepository.GetServicingOptionDepartureTimeWindows().Select(
                    x => new { value = x, text = x }
                    ), "value", "text", servicingOptionItem.DepartureTimeWindowMinutes);

            ViewData["ArrivalTimeWindowMinutesList"] = new SelectList(
                servicingOptionRepository.GetServicingOptionArrivalTimeWindows().Select(
                    x => new { value = x, text = x }
                    ), "value", "text", servicingOptionItem.ArrivalTimeWindowMinutes);

            ViewData["MaximumStopsList"] = new SelectList(
                servicingOptionRepository.GetServicingOptionMaximumStops().Select(
                    x => new { value = x, text = x }
                    ), "value", "text", servicingOptionItem.MaximumStops);

            servicingOptionItemRepository.EditItemForDisplay(servicingOptionItem);
            return(View(servicingOptionItem));
        }
        // GET: Create
        public ActionResult Create(string id)
        {
            //Set Access Rights
            ViewData["Access"] = "";
            RolesRepository rolesRepository = new RolesRepository();

            if (rolesRepository.HasWriteAccessToClientSubUnit(id) && hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Access"] = "WriteAccess";
            }

            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(id);

            //Check clientSubUnit
            if (clientSubUnit == null)
            {
                ViewData["ActionMethod"] = "List";
                return(View("RecordDoesNotExistError"));
            }

            clientSubUnitRepository.EditGroupForDisplay(clientSubUnit);

            ViewData["ClientSubUnitName"] = clientSubUnit.ClientSubUnitDisplayName;
            ViewData["ClientSubUnitGuid"] = clientSubUnit.ClientSubUnitGuid;
            ViewData["ClientTopUnitName"] = clientSubUnit.ClientTopUnitName;
            ViewData["ClientTopUnitGuid"] = clientSubUnit.ClientTopUnitGuid;

            PNRNameStatementInformationVM PNRNameStatementInformationVM = new PNRNameStatementInformationVM();
            PNRNameStatementInformation   PNRNameStatementInformation   = new PNRNameStatementInformation();

            PNRNameStatementInformation.ClientSubUnit = clientSubUnit;
            PNRNameStatementInformationVM.PNRNameStatementInformation = PNRNameStatementInformation;
            PNRNameStatementInformationVM.ClientSubUnit = clientSubUnit;

            //GDS
            GDSRepository GDSRepository = new GDSRepository();

            PNRNameStatementInformationVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName");

            //Delimiters
            PNRNameStatementInformationVM.Delimiters = new SelectList(PNRNameStatementInformationRepository.GetPNRNameStatementInformationDelimiters().ToList(), "Value", "Text");

            //Statement Info
            PNRNameStatementInformationVM.StatementInformationItems = new SelectList(PNRNameStatementInformationRepository.GetPNRNameStatementInformationStatementInformation(id).ToList(), "Value", "Text");

            return(View(PNRNameStatementInformationVM));
        }
        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));
        }
Ejemplo n.º 13
0
        public JsonResult Publish(int clientProfileGroupId, string sabreStatus, string gdsCode)
        {
            //Get Item From Database
            ClientProfileGroup clientProfileGroup = new ClientProfileGroup();

            clientProfileGroup = clientProfileGroupRepository.GetGroup(clientProfileGroupId);

            //Check Exists in Database
            if (clientProfileGroup == null)
            {
                ViewData["ActionMethod"] = "DeletePost";
                return(Json("Record Does Not Exist Error"));
            }

            //Check Access
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientProfileGroup(clientProfileGroup.ClientProfileGroupId))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(Json("Error"));
            }

            GDS           gds           = new GDS();
            GDSRepository gdsRepository = new GDSRepository();

            gds = gdsRepository.GetGDS(clientProfileGroup.GDSCode);

            string gdsName = gds.GDSName;

            switch (gdsCode)
            {
            case "1S":
                gdsName = sabreStatus;
                break;
            }

            string response = DoPublish(clientProfileGroup, gds, gdsName, clientProfileGroup.PseudoCityOrOfficeId, false);

            return(Json(response));
        }
        // 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)
        {
            //Check Exists
            ServicingOptionGroup servicingOptionGroup = new ServicingOptionGroup();

            servicingOptionGroup = servicingOptionGroupRepository.GetGroup(id);
            if (servicingOptionGroup == null)
            {
                ViewData["ActionMethod"] = "CreateGet";
                return(View("RecordDoesNotExistError"));
            }

            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToServicingOptionGroup(id))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }
            ServicingOptionRepository servicingOptionRepository = new ServicingOptionRepository();
            SelectList servicingOptionsList = new SelectList(servicingOptionRepository.GetAvailableServicingOptions(id).ToList(), "ServicingOptionId", "ServicingOptionName");

            ViewData["ServicingOptions"] = servicingOptionsList;

            GDSRepository gdsRepository = new GDSRepository();
            SelectList    gDSList       = new SelectList(gdsRepository.GetAllGDSsExceptALL().ToList(), "GDSCode", "GDSName");

            ViewData["GDSs"] = gDSList;

            ViewData["DepartureTimeWindowMinutesList"] = new SelectList(servicingOptionRepository.GetServicingOptionDepartureTimeWindows().Select(x => new { value = x, text = x }), "value", "text");
            ViewData["ArrivalTimeWindowMinutesList"]   = new SelectList(servicingOptionRepository.GetServicingOptionArrivalTimeWindows().Select(x => new { value = x, text = x }), "value", "text");
            ViewData["MaximumStopsList"] = new SelectList(servicingOptionRepository.GetServicingOptionMaximumStops().Select(x => new { value = x, text = x }), "value", "text");

            ServicingOptionItem servicingOptionItem = new ServicingOptionItem();

            servicingOptionItem.ServicingOptionGroupName = servicingOptionGroup.ServicingOptionGroupName;
            servicingOptionItem.ServicingOptionGroupId   = servicingOptionGroup.ServicingOptionGroupId;

            return(View(servicingOptionItem));
        }
Ejemplo n.º 16
0
        // 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(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;

            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: /GDSEndWarningConfiguration/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"));
            }

            GDSEndWarningConfigurationVM gdsEndWarningConfigurationVM = new GDSEndWarningConfigurationVM();

            //GDS List
            GDSRepository gDSRepository = new GDSRepository();
            SelectList    gDSs          = new SelectList(gDSRepository.GetClientProfileBuilderGDSs().ToList(), "GDSCode", "GDSName");

            gdsEndWarningConfigurationVM.GDSs = gDSs;

            //GDSEndWarningBehaviorTypes
            GDSEndWarningBehaviorTypeRepository gdsEndWarningBehaviorTypeRepository = new GDSEndWarningBehaviorTypeRepository();
            SelectList gdsEndWarningBehaviorTypes = new SelectList(gdsEndWarningBehaviorTypeRepository.GetAllGDSEndWarningBehaviorTypes().ToList(), "GDSEndWarningBehaviorTypeId", "GDSEndWarningBehaviorTypeDescription");

            gdsEndWarningConfigurationVM.GDSEndWarningBehaviorTypes = gdsEndWarningBehaviorTypes;

            //Automated Commands
            List <AutomatedCommand> automatedCommands = new List <AutomatedCommand>();
            AutomatedCommand        automatedCommand  = new AutomatedCommand();

            automatedCommands.Add(automatedCommand);
            gdsEndWarningConfigurationVM.AutomatedCommands = automatedCommands;

            GDSEndWarningConfiguration gdsEndWarningConfiguration = new GDSEndWarningConfiguration();

            gdsEndWarningConfigurationVM.GDSEndWarningConfiguration = gdsEndWarningConfiguration;

            return(View(gdsEndWarningConfigurationVM));
        }
Ejemplo n.º 20
0
        public ActionResult Delete(int id)
        {
            //Get BookingChannel
            BookingChannel bookingChannel = new BookingChannel();

            bookingChannel = bookingChannelRepository.BookingChannel(id);

            //Check Exists
            if (bookingChannel == null)
            {
                ViewData["ActionMethod"] = "DeleteGet";
                return(View("RecordDoesNotExistError"));
            }

            //Access Rights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientSubUnit(bookingChannel.ClientSubUnitGuid) || !hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            BookingChannelVM bookingChannelVM = new BookingChannelVM();

            bookingChannelVM.BookingChannel = bookingChannel;

            //Get ClientSubUnit
            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(bookingChannel.ClientSubUnitGuid);
            bookingChannelVM.ClientSubUnit = clientSubUnit;

            //Get GDS
            GDSRepository gdsRepository = new GDSRepository();
            GDS           gds           = gdsRepository.GetGDS(bookingChannel.GDSCode);

            bookingChannelVM.GDS = gds;

            //Channel Products
            if (bookingChannel.ProductChannelTypeId != null)
            {
                ProductChannelTypeRepository productChannelTypeRepository = new ProductChannelTypeRepository();
                ProductChannelType           productChannelType           = productChannelTypeRepository.GetProductChannelType((int)bookingChannel.ProductChannelTypeId);
                if (productChannelType != null)
                {
                    bookingChannelVM.BookingChannel.ProductChannelType = productChannelType;
                }
            }

            //Desktop Used Types
            if (bookingChannel.DesktopUsedTypeId != null)
            {
                DesktopUsedTypeRepository desktopUsedTypeRepository = new DesktopUsedTypeRepository();
                DesktopUsedType           desktopUsedType           = desktopUsedTypeRepository.GetDesktopUsedType((int)bookingChannel.DesktopUsedTypeId);
                if (desktopUsedType != null)
                {
                    bookingChannelVM.BookingChannel.DesktopUsedType = desktopUsedType;
                }
            }

            //Content Booked Items
            ContentBookedItemRepository contentBookedItemRepository = new ContentBookedItemRepository();
            List <ContentBookedItem>    contentBookedItems          = contentBookedItemRepository.GetBookingChannelContentBookedItems(bookingChannel.BookingChannelId).ToList();

            if (contentBookedItems != null)
            {
                bookingChannelVM.ContentBookedItemsList = String.Join(", ", contentBookedItems.Select(x => x.Product.ProductName.ToString()).ToArray());
            }

            //Show Form
            return(View(bookingChannelVM));
        }
Ejemplo n.º 21
0
        // GET: /View
        public ActionResult View(int id)
        {
            //Get BookingChannel
            BookingChannel bookingChannel = new BookingChannel();

            bookingChannel = bookingChannelRepository.BookingChannel(id);

            //Check Exists
            if (bookingChannel == null)
            {
                ViewData["ActionMethod"] = "DeleteGet";
                return(View("RecordDoesNotExistError"));
            }

            BookingChannelVM bookingChannelVM = new BookingChannelVM();

            bookingChannelVM.BookingChannel = bookingChannel;

            //Get ClientSubUnit
            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(bookingChannel.ClientSubUnitGuid);
            bookingChannelVM.ClientSubUnit = clientSubUnit;

            //Get GDS
            GDSRepository gdsRepository = new GDSRepository();
            GDS           gds           = gdsRepository.GetGDS(bookingChannel.GDSCode);

            bookingChannelVM.GDS = gds;

            //Channel Products
            if (bookingChannel.ProductChannelTypeId != null)
            {
                ProductChannelTypeRepository productChannelTypeRepository = new ProductChannelTypeRepository();
                ProductChannelType           productChannelType           = productChannelTypeRepository.GetProductChannelType((int)bookingChannel.ProductChannelTypeId);
                if (productChannelType != null)
                {
                    bookingChannelVM.BookingChannel.ProductChannelType = productChannelType;
                }
            }

            //Desktop Used Types
            if (bookingChannel.DesktopUsedTypeId != null)
            {
                DesktopUsedTypeRepository desktopUsedTypeRepository = new DesktopUsedTypeRepository();
                DesktopUsedType           desktopUsedType           = desktopUsedTypeRepository.GetDesktopUsedType((int)bookingChannel.DesktopUsedTypeId);
                if (desktopUsedType != null)
                {
                    bookingChannelVM.BookingChannel.DesktopUsedType = desktopUsedType;
                }
            }

            //Content Booked Items
            ContentBookedItemRepository contentBookedItemRepository = new ContentBookedItemRepository();
            List <ContentBookedItem>    contentBookedItems          = contentBookedItemRepository.GetBookingChannelContentBookedItems(bookingChannel.BookingChannelId).ToList();

            if (contentBookedItems != null)
            {
                bookingChannelVM.ContentBookedItemsList = String.Join(", ", contentBookedItems.Select(x => x.Product.ProductName.ToString()).ToArray());
            }

            //Show Form
            return(View(bookingChannelVM));
        }
Ejemplo n.º 22
0
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get BookingChannel
            BookingChannel bookingChannel = new BookingChannel();

            bookingChannel = bookingChannelRepository.BookingChannel(id);

            //Check Exists
            if (bookingChannel == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Access Rights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientSubUnit(bookingChannel.ClientSubUnitGuid) || !hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            BookingChannelVM bookingChannelVM = new BookingChannelVM();

            bookingChannelVM.BookingChannel = bookingChannel;

            //Get ClientSubUnit
            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(bookingChannel.ClientSubUnitGuid);
            bookingChannelVM.ClientSubUnit = clientSubUnit;


            //Booking Channel Types
            BookingChannelTypeRepository bookingChannelTypeRepository = new BookingChannelTypeRepository();

            if (bookingChannelVM.BookingChannel.BookingChannelTypeId != null)
            {
                bookingChannelVM.BookingChannelTypes = new SelectList(
                    bookingChannelTypeRepository.GetAllBookingChannelTypes().ToList(),
                    "BookingChannelTypeId",
                    "BookingChannelTypeDescription",
                    bookingChannelVM.BookingChannel.BookingChannelTypeId
                    );
            }
            else
            {
                bookingChannelVM.BookingChannelTypes = new SelectList(
                    bookingChannelTypeRepository.GetAllBookingChannelTypes().ToList(),
                    "BookingChannelTypeId",
                    "BookingChannelTypeDescription"
                    );
            }

            //Channel Products
            ProductChannelTypeRepository productChannelTypeRepository = new ProductChannelTypeRepository();
            int bookingChannelTypeId = (bookingChannelVM.BookingChannel.BookingChannelTypeId != null) ? bookingChannelVM.BookingChannel.BookingChannelTypeId.Value : 1;

            bookingChannelVM.ProductChannelTypes = new SelectList(
                productChannelTypeRepository.GetProductChannelTypesForBookingChannel(bookingChannelTypeId).ToList(),
                "ProductChannelTypeId",
                "ProductChannelTypeDescription",
                bookingChannelVM.BookingChannel.ProductChannelTypeId
                );

            //Desktop Used Types
            DesktopUsedTypeRepository desktopUsedTypeRepository = new DesktopUsedTypeRepository();

            if (bookingChannelVM.BookingChannel.DesktopUsedTypeId != null)
            {
                bookingChannelVM.DesktopUsedTypes = new SelectList(
                    desktopUsedTypeRepository.GetAllDesktopUsedTypes().ToList(),
                    "DesktopUsedTypeId",
                    "DesktopUsedTypeDescription",
                    bookingChannelVM.BookingChannel.DesktopUsedTypeId
                    );
            }
            else
            {
                bookingChannelVM.DesktopUsedTypes = new SelectList(
                    desktopUsedTypeRepository.GetAllDesktopUsedTypes().ToList(),
                    "DesktopUsedTypeId",
                    "DesktopUsedTypeDescription"
                    );
            }

            //Content Booked Items
            ContentBookedItemRepository contentBookedItemRepository = new ContentBookedItemRepository();
            List <ContentBookedItem>    contentBookedItems          = contentBookedItemRepository.GetBookingChannelContentBookedItems(bookingChannelVM.BookingChannel.BookingChannelId).ToList();

            ProductRepository            productRepository = new ProductRepository();
            IEnumerable <SelectListItem> defaultProducts   = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName");

            List <SelectListItem> contentBookedItemsSelected = new List <SelectListItem>();

            foreach (SelectListItem item in defaultProducts)
            {
                bool selected = false;

                foreach (ContentBookedItem contentBookedItem in contentBookedItems)
                {
                    if (item.Value == contentBookedItem.Product.ProductId.ToString())
                    {
                        selected = true;
                    }
                }

                contentBookedItemsSelected.Add(
                    new SelectListItem()
                {
                    Text     = item.Text,
                    Value    = item.Value,
                    Selected = selected
                }
                    );
            }

            bookingChannelVM.ContentBookedItemsSelected = contentBookedItemsSelected;

            //GDS
            GDSRepository GDSRepository = new GDSRepository();

            bookingChannelVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName");

            //Show Edit Form
            return(View(bookingChannelVM));
        }
Ejemplo n.º 23
0
        // GET: /Edit
        public ActionResult Edit(int id, string csu, string can, string ssc)
        {
            ClientDefinedReferenceItemPNROutputVM clientDefinedReferenceItemPNROutputVM = new ClientDefinedReferenceItemPNROutputVM();

            ClientDefinedReferenceItemPNROutput clientDefinedReferenceItemPNROutput = new ClientDefinedReferenceItemPNROutput();

            clientDefinedReferenceItemPNROutput = clientDefinedReferenceItemPNROutputRepository.GetClientDefinedReferenceItemPNROutput(id);
            if (clientDefinedReferenceItemPNROutput == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return(View("RecordDoesNotExistError"));
            }

            clientDefinedReferenceItemPNROutputVM.ClientDefinedReferenceItemPNROutput = clientDefinedReferenceItemPNROutput;

            //Check Exists
            ClientDefinedReferenceItem clientDefinedReferenceItem = new ClientDefinedReferenceItem();

            clientDefinedReferenceItem = clientDefinedReferenceItemRepository.GetClientDefinedReferenceItem(clientDefinedReferenceItemPNROutput.ClientDefinedReferenceItemId);
            if (clientDefinedReferenceItem == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return(View("RecordDoesNotExistError"));
            }

            ViewData["DsplayName"] = !string.IsNullOrEmpty(clientDefinedReferenceItem.DisplayNameAlias) ? clientDefinedReferenceItem.DisplayNameAlias : clientDefinedReferenceItem.DisplayName;

            //Check Exists CSU for VM
            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu);
            if (clientSubUnit != null)
            {
                clientSubUnitRepository.EditGroupForDisplay(clientSubUnit);
                clientDefinedReferenceItemPNROutputVM.ClientSubUnit = clientSubUnit;
            }

            // Check Exists CDR CSU (can be null)
            ClientSubUnit clientSubUnitCDR = new ClientSubUnit();

            if (clientDefinedReferenceItem.ClientSubUnitGuid != null)
            {
                clientSubUnitCDR = clientSubUnitRepository.GetClientSubUnit(clientDefinedReferenceItem.ClientSubUnitGuid);
                if (clientSubUnit != null)
                {
                    clientSubUnitRepository.EditGroupForDisplay(clientSubUnitCDR);
                    clientDefinedReferenceItem.ClientSubUnitGuid = clientSubUnitCDR.ClientSubUnitGuid;
                }
            }

            if (can != null && ssc != null)
            {
                ClientSubUnitClientAccount clientSubUnitClientAccount = new ClientSubUnitClientAccount();
                clientSubUnitClientAccount = clientSubUnitClientAccountRepository.GetClientSubUnitClientAccount(can, ssc, csu);
                if (clientSubUnitClientAccount != null)
                {
                    ViewData["ClientSubUnitClientAccountClientAccountName"] = clientSubUnitClientAccount.ClientAccount.ClientAccountName;
                }

                clientDefinedReferenceItem.ClientAccountNumber = clientDefinedReferenceItem.ClientAccountNumber;
                clientDefinedReferenceItem.SourceSystemCode    = clientDefinedReferenceItem.SourceSystemCode;
            }

            if (can != null && ssc != null)
            {
                ClientAccount           clientAccount           = new ClientAccount();
                ClientAccountRepository clientAccountRepository = new ClientAccountRepository();
                clientAccount = clientAccountRepository.GetClientAccount(can, ssc);
                if (clientAccount != null)
                {
                    ViewData["ClientAccountName"] = clientAccount.ClientAccountName;
                }

                clientDefinedReferenceItem.ClientAccountNumber = can;
                clientDefinedReferenceItem.SourceSystemCode    = ssc;
                ViewData["ClientDefinedReferenceItemId"]       = clientDefinedReferenceItem.ClientDefinedReferenceItemId;
                ViewData["ClientAccountNumber"] = can;
                ViewData["SourceSystemCode"]    = ssc;
            }

            //ClientDefinedReferenceItem
            clientDefinedReferenceItemPNROutput.ClientDefinedReferenceItem   = clientDefinedReferenceItem;
            clientDefinedReferenceItemPNROutput.ClientDefinedReferenceItemId = clientDefinedReferenceItem.ClientDefinedReferenceItemId;

            //GDS
            GDSRepository GDSRepository = new GDSRepository();

            clientDefinedReferenceItemPNROutputVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName");

            //PNR Output Remark Types
            PNROutputRemarkTypeRepository PNROutputRemarkTypeRepository = new PNROutputRemarkTypeRepository();

            clientDefinedReferenceItemPNROutputVM.PNROutputRemarkTypeCodes = new SelectList(PNROutputRemarkTypeRepository.GetPNROutputRemarkTypes(), "PNROutputRemarkTypeCode", "PNROutputRemarkTypeName");

            //Languages
            LanguageRepository languageRepository = new LanguageRepository();

            clientDefinedReferenceItemPNROutputVM.Languages = new SelectList(languageRepository.GetAllLanguages().ToList(), "LanguageCode", "LanguageName");

            return(View(clientDefinedReferenceItemPNROutputVM));
        }
Ejemplo n.º 24
0
        // GET: /Create
        public ActionResult Create(string id, string csu, string can, string ssc)
        {
            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(csu);

            //Check Exists
            if (clientSubUnit == null)
            {
                ViewData["ActionMethod"] = "CreateGet";
                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"));
            }

            ClientDefinedReferenceItemPNROutputVM clientDefinedReferenceItemPNROutputVM = new ClientDefinedReferenceItemPNROutputVM();

            ClientDefinedReferenceItem clientDefinedReferenceItem = new ClientDefinedReferenceItem();

            clientDefinedReferenceItem = clientDefinedReferenceItemRepository.GetClientDefinedReferenceItem(id);

            ClientDefinedReferenceItemPNROutput clientDefinedReferenceItemPNROutput = new ClientDefinedReferenceItemPNROutput();

            //ClientDefinedReferenceItem
            if (clientDefinedReferenceItem == null)
            {
                ViewData["ActionMethod"] = "CreateGet";
                return(View("RecordDoesNotExistError"));
            }

            clientDefinedReferenceItem.ClientSubUnitGuid = clientSubUnit.ClientSubUnitGuid;
            clientDefinedReferenceItemPNROutput.ClientDefinedReferenceItem   = clientDefinedReferenceItem;
            clientDefinedReferenceItemPNROutput.ClientDefinedReferenceItemId = clientDefinedReferenceItem.ClientDefinedReferenceItemId;

            clientDefinedReferenceItemPNROutputVM.ClientDefinedReferenceItemPNROutput = clientDefinedReferenceItemPNROutput;

            ViewData["DsplayName"] = !string.IsNullOrEmpty(clientDefinedReferenceItem.DisplayNameAlias) ? clientDefinedReferenceItem.DisplayNameAlias : clientDefinedReferenceItem.DisplayName;

            if (can != null && ssc != null)
            {
                ClientSubUnitClientAccount clientSubUnitClientAccount = new ClientSubUnitClientAccount();
                clientSubUnitClientAccount = clientSubUnitClientAccountRepository.GetClientSubUnitClientAccount(can, ssc, clientSubUnit.ClientSubUnitGuid);
                if (clientSubUnitClientAccount != null)
                {
                    ViewData["ClientSubUnitClientAccountClientAccountName"] = clientSubUnitClientAccount.ClientAccount.ClientAccountName;
                }

                clientDefinedReferenceItem.ClientAccountNumber = can;
                clientDefinedReferenceItem.SourceSystemCode    = ssc;
                ViewData["ClientDefinedReferenceItemId"]       = clientDefinedReferenceItem.ClientDefinedReferenceItemId;
                ViewData["ClientAccountNumber"] = can;
                ViewData["SourceSystemCode"]    = ssc;
            }

            //ClientSubUnit
            clientDefinedReferenceItemPNROutputVM.ClientSubUnit = clientSubUnit;

            //GDS
            GDSRepository GDSRepository = new GDSRepository();

            clientDefinedReferenceItemPNROutputVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName");

            //PNR Output Remark Types
            PNROutputRemarkTypeRepository PNROutputRemarkTypeRepository = new PNROutputRemarkTypeRepository();

            clientDefinedReferenceItemPNROutputVM.PNROutputRemarkTypeCodes = new SelectList(PNROutputRemarkTypeRepository.GetPNROutputRemarkTypes(), "PNROutputRemarkTypeCode", "PNROutputRemarkTypeName", "");

            //Languages
            LanguageRepository languageRepository = new LanguageRepository();

            clientDefinedReferenceItemPNROutputVM.Languages = new SelectList(languageRepository.GetAllLanguages().ToList(), "LanguageCode", "LanguageName");

            return(View(clientDefinedReferenceItemPNROutputVM));
        }
Ejemplo n.º 25
0
        public JsonResult IsProfileReadytoPublish(string clientProfileGroupId)
        {
            if (clientProfileGroupId == null)
            {
                return(Json("No Id"));
            }

            int id = Int32.Parse(clientProfileGroupId);

            string retval = "true";

            //Get Item From Database
            ClientProfileGroup clientProfileGroup = new ClientProfileGroup();

            clientProfileGroup = clientProfileGroupRepository.GetGroup(id);

            //Get GDS
            GDS           gds           = new GDS();
            GDSRepository gdsRepository = new GDSRepository();

            gds = gdsRepository.GetGDS(clientProfileGroup.GDSCode);

            //Check Exists
            if (clientProfileGroup == null)
            {
                retval = "RecordDoesNotExistError";
            }

            //Check Access
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientProfileGroup(id))
            {
                retval = "You do not have access to this item";
            }

            List <ClientProfileItemVM> clientProfileItemsList = GDSIntegration.GetProfileLineItems(id, true);

            bool doIncompleteFieldsExists = false;

            //Check if all mandatory fields are complete
            foreach (ClientProfileItemVM clientProfileItemVM in clientProfileItemsList)
            {
                ClientProfileItemRow clientProfileItemRow = clientProfileItemVM.ClientProfileItem;

                if (clientProfileItemRow.MandatoryFlag == true && (
                        clientProfileItemRow.ClientProfileMoveStatusId == null ||
                        string.IsNullOrEmpty(clientProfileItemRow.Remark) ||
                        string.IsNullOrEmpty(clientProfileItemRow.GDSCommandFormat)))
                {
                    doIncompleteFieldsExists = true;
                }
            }

            if (doIncompleteFieldsExists)
            {
                return(Json("There are incomplete mandatory elements.<br/><br/>Please return to the Items page and correct the error."));
            }

            //Check Line Counts
            int lineCount    = clientProfileItemsList.Count();
            int maxLineCount = 0;

            switch (gds.GDSName)
            {
            case "Apollo":
                maxLineCount = 200;
                break;

            case "Amadeus":
                maxLineCount = 100;
                break;

            case "Galileo":
                maxLineCount = 200;
                break;

            case "Sabre":
                maxLineCount = 200;
                break;
            }

            if (lineCount > maxLineCount)
            {
                retval = "The client profile exceeds the maximum number of lines.<br/><br/>Please return to the Items page and correct the error.";
            }

            return(Json(retval));
        }
Ejemplo n.º 26
0
        // 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));
        }
Ejemplo n.º 27
0
        // GET: /Create
        public ActionResult Create(string id)
        {
            //Get ClientSubUnit
            ClientSubUnit clientSubUnit = new ClientSubUnit();

            clientSubUnit = clientSubUnitRepository.GetClientSubUnit(id);

            //Check Exists
            if (clientSubUnit == null)
            {
                ViewData["ActionMethod"] = "CreateGet";
                return(View("RecordDoesNotExistError"));
            }

            //Access Rights
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientSubUnit(id) || !hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            BookingChannelVM bookingChannelVM = new BookingChannelVM();

            bookingChannelVM.ClientSubUnit = clientSubUnit;

            BookingChannel bookingChannel = new BookingChannel();

            bookingChannel.ClientSubUnit     = clientSubUnit;
            bookingChannel.ClientSubUnitGuid = clientSubUnit.ClientSubUnitGuid;
            bookingChannelVM.BookingChannel  = bookingChannel;

            //Usage Types
            UsageTypeRepository usageTypeRepository = new UsageTypeRepository();

            bookingChannelVM.UsageTypes = new SelectList(usageTypeRepository.GetAvailableUsageTypes(id).ToList(), "UsageTypeId", "UsageTypeDescription");

            //Booking Channel Types
            BookingChannelTypeRepository bookingChannelTypeRepository = new BookingChannelTypeRepository();

            bookingChannelVM.BookingChannelTypes = new SelectList(bookingChannelTypeRepository.GetAllBookingChannelTypes().ToList(), "BookingChannelTypeId", "BookingChannelTypeDescription");

            //Channel Products
            ProductChannelTypeRepository productChannelTypeRepository = new ProductChannelTypeRepository();

            bookingChannelVM.ProductChannelTypes = new SelectList(productChannelTypeRepository.GetAllProductChannelTypes().ToList(), "ProductChannelTypeId", "ProductChannelTypeDescription");

            //Desktop Used Types
            DesktopUsedTypeRepository desktopUsedTypeRepository = new DesktopUsedTypeRepository();

            bookingChannelVM.DesktopUsedTypes = new SelectList(desktopUsedTypeRepository.GetAllDesktopUsedTypes().ToList(), "DesktopUsedTypeId", "DesktopUsedTypeDescription");

            //Content Booked Items
            ProductRepository productRepository = new ProductRepository();

            bookingChannelVM.Products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName");

            GDSRepository GDSRepository = new GDSRepository();

            bookingChannelVM.GDSList = new SelectList(GDSRepository.GetAllGDSsExceptALL().OrderBy(x => x.GDSName).ToList(), "GDSCode", "GDSName");

            //Show Create Form
            return(View(bookingChannelVM));
        }
Ejemplo n.º 28
0
        // 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: /ClientProfileItem/List

        public ActionResult List(int id, int?clientProfilePanelId)
        {
            ClientProfileItemsVM clientProfileItemsVM = new ClientProfileItemsVM();

            //Set Access Rights
            if (hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                clientProfileItemsVM.HasDomainWriteAccess = true;
            }

            //Get the ClientProfileGroup
            ClientProfileGroup clientProfileGroup = new ClientProfileGroup();

            clientProfileGroup = clientProfileGroupRepository.GetGroup(id);
            clientProfileGroupRepository.EditGroupForDisplay(clientProfileGroup);
            clientProfileItemsVM.ClientProfileGroup = clientProfileGroup;

            clientProfileItemsVM.ClientProfileGroupId = clientProfileGroup.ClientProfileGroupId;
            clientProfileItemsVM.ClientProfileGroupClientProfileGroupName = clientProfileGroup.ClientProfileGroupName;

            GDS           gds           = new GDS();
            GDSRepository gdsRepository = new GDSRepository();

            gds = gdsRepository.GetGDS(clientProfileGroup.GDSCode);
            clientProfileItemsVM.ClientProfileGroupGDSName = gds.GDSName;

            clientProfileItemsVM.ClientProfileGroupHierarchyItem = clientProfileGroup.HierarchyItem;
            clientProfileItemsVM.ClientProfileGroupBackOfficeSystemDescription = clientProfileGroup.BackOfficeSystem.BackOfficeSystemDescription;
            clientProfileItemsVM.ClientProfilePanelId = clientProfilePanelId ?? 0;

            //Get ClientTopUnit
            if (clientProfileGroup.HierarchyType == "ClientSubUnit")
            {
                ClientProfileGroupClientSubUnit clientProfileGroupClientSubUnit = clientProfileGroup.ClientProfileGroupClientSubUnits.SingleOrDefault();
                if (clientProfileGroupClientSubUnit != null)
                {
                    ClientSubUnitRepository clientSubUnitRepository = new ClientSubUnitRepository();
                    ClientSubUnit           clientSubUnit           = new ClientSubUnit();
                    clientSubUnit = clientSubUnitRepository.GetClientSubUnit(clientProfileGroupClientSubUnit.ClientSubUnitGuid);
                    if (clientSubUnit != null)
                    {
                        if (clientSubUnit.ClientTopUnit != null)
                        {
                            ViewData["ClientTopUnitName"] = clientSubUnit.ClientTopUnit.ClientTopUnitName;
                        }
                    }
                }
            }

            //Get a list of ClientProfileItems for each panel
            clientProfileItemsVM.ClientProfileItemsClientDetails = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 6);
            clientProfileItemsVM.ClientProfileItemsMidOffice     = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 3);
            clientProfileItemsVM.ClientProfileItemsBackOffice    = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 5);
            clientProfileItemsVM.ClientProfileItemsAirRailPolicy = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 7);
            clientProfileItemsVM.ClientProfileItemsItinerary     = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 9);
            clientProfileItemsVM.ClientProfileItems24Hours       = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 10);
            clientProfileItemsVM.ClientProfileItemsAmadeusTPM    = clientProfileItemRepository.GetClientProfilePanelClientProfileDataElements(id, 11);

            /*GDS Integration*/
            //https://docs.google.com/document/d/1TMOvJzZmePKjFTt0qFUC6_JGRz0x508uIiV3jGCa7b0/

            //TLS Update
            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

            ClientProfileService lService          = null;
            StringBuilder        clientProfileText = new StringBuilder();

            //Format PCC String
            string formattedPcc = GDSIntegration.FormatPccString(clientProfileGroup.PseudoCityOrOfficeId);

            try
            {
                //This is a singleton, and should be used strictly to retrieve existing profiles from the GDS
                lService = ClientProfileService.getInstance;
            }
            catch (Exception ex)
            {
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                //Generic Error
                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(View("Error"));
            }

            if (lService != null)
            {
                try
                {
                    //string pGds, string pPcc, string pZeroLevel, string pCompanyProfileName, stringpTravellerProfileName
                    ClientProfileResponse clientProfileResponse = lService.GetProfile(gds.GDSName, formattedPcc, "", clientProfileGroup.ClientProfileGroupName, "");
                    if (clientProfileResponse != null)
                    {
                        if (clientProfileResponse.Result != CWTResponse.ResultStatus.Error)
                        {
                            if (clientProfileResponse.ClientProfile != null)
                            {
                                ClientProfile clientProfile = clientProfileResponse.ClientProfile;
                                if (clientProfile != null)
                                {
                                    if (clientProfile.ProfileLines.Count > 0)
                                    {
                                        //Loop through the profile and write out the lines
                                        foreach (ClientProfileLine line in clientProfile.ProfileLines)
                                        {
                                            //&#13;&#10; is new line
                                            clientProfileText.AppendFormat("{0} {1}&#13;&#10;", line.LineNumber, line.LineText);
                                        }

                                        //Pass content into view if exists
                                        if (!string.IsNullOrEmpty(clientProfileText.ToString()))
                                        {
                                            ViewData["clientProfileText"] = clientProfileText.ToString();
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            //Log Get Profile error messages and show error in GDS window
                            if (clientProfileResponse.MessageList.Count > 0)
                            {
                                string errorMessage = string.Empty;

                                foreach (string message in clientProfileResponse.MessageList)
                                {
                                    errorMessage += string.Format("{0}&#13;&#10;", message);
                                }

                                if (!string.IsNullOrEmpty(errorMessage))
                                {
                                    ViewData["clientProfileText"] = errorMessage;
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    LogRepository logRepository = new LogRepository();
                    logRepository.LogError(ex.Message);

                    //Generic Error
                    ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                    return(View("Error"));
                }
            }

            return(View(clientProfileItemsVM));
        }
Ejemplo n.º 30
0
        public JsonResult Verify(int clientProfileGroupId, string sabreStatus, string gdsCode)
        {
            //Get Item From Database
            ClientProfileGroup clientProfileGroup = new ClientProfileGroup();

            clientProfileGroup = clientProfileGroupRepository.GetGroup(clientProfileGroupId);

            //Check Exists in Databsase
            if (clientProfileGroup == null)
            {
                ViewData["ActionMethod"] = "DeletePost";
                return(Json("Record Does Not Exist Error"));
            }

            //Check Access
            RolesRepository rolesRepository = new RolesRepository();

            if (!rolesRepository.HasWriteAccessToClientProfileGroup(clientProfileGroup.ClientProfileGroupId))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(Json("Error"));
            }

            GDS           gds           = new GDS();
            GDSRepository gdsRepository = new GDSRepository();

            gds = gdsRepository.GetGDS(clientProfileGroup.GDSCode);

            string verifyPCC = string.Empty;
            string gdsName   = gds.GDSName;

            switch (gdsCode)
            {
            case "1G":
                verifyPCC = ConfigurationManager.AppSettings["VerifyPCC_Galileo"].ToString();
                break;

            case "1V":
                verifyPCC = ConfigurationManager.AppSettings["VerifyPCC_Apollo"].ToString();
                break;

            case "1A":
                verifyPCC = ConfigurationManager.AppSettings["VerifyPCC_Amadeus"].ToString();
                break;

            case "1S":
                verifyPCC = ConfigurationManager.AppSettings["VerifyPCC_Sabre"].ToString();
                gdsName   = sabreStatus;
                break;
            }

            if (string.IsNullOrEmpty(verifyPCC))
            {
                //Need to add values into web config
                LogRepository logRepository = new LogRepository();
                logRepository.LogError("Please ensure verify PCC is present for GDS");
                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(Json("There was a problem with your request, please see the log file or contact an administrator for details"));
            }

            string response = DoPublish(clientProfileGroup, gds, gdsName, verifyPCC, true);

            return(Json(response));
        }