コード例 #1
0
        private void CopyInitialProperties()
        {
            string pathProperties = GlobalConstants.PATH_SABRE_USER + "\\emulator.properties";
            string sourcefile     = string.Format(@"{0}\emulator.properties", GlobalConstants.PATH_SABRE_USER);
            string content        = string.Empty;

            if (!File.Exists(pathProperties))
            {
                GetFilesBD(GlobalConstants.PATH_SABRE_USER, "emulator.properties", true);
                using (StreamReader sr = new StreamReader(sourcefile, System.Text.Encoding.UTF8))
                {
                    content = sr.ReadToEnd();
                    content = content.Replace("[**AGENT_ID**]", Login.Firm);
                }

                using (StreamWriter sw = new StreamWriter(pathProperties, false, System.Text.Encoding.UTF8))
                {
                    sw.Write(content);
                }
            }
            if (!File.Exists(GlobalConstants.PATH_SABRE_COMPILED + "\\AutomatedHotelPrompt_SP.SSC"))
            {
                List <BannerImage> BannerImageList = GetBannerImageBL.GetBannerImageList("4");
                if (BannerImageList.Count > 0)
                {
                    Byte[] doc = BannerImageList[0].Content;
                    File.WriteAllBytes(GlobalConstants.PATH_SABRE_COMPILED + "\\AutomatedHotelPrompt_SP.SSC", doc);
                }
            }
        }
コード例 #2
0
        private void InitialValidations()
        {
            try
            {
                if (this.Parameters != null)
                {
                    if (this.Parameters.Length.Equals(1))
                    {
                        lblTA.Text = this.Parameters[0];
                        BannerImageList.Clear();
                        lblStateConection.Text      = "No Conectado";
                        lblStateConection.ForeColor = Color.Red;
                        string sabreAnswer = string.Empty;
                        string ta          = string.Empty;
                        string send        = "‡J";
                        using (CommandsAPI objCommand = new CommandsAPI())
                        {
                            sabreAnswer = objCommand.SendReceive(send);
                        }

                        CommandsQik.CopyResponse(sabreAnswer, ref ta, 1, 21, 6);
                        SetTABL.SetTa(Login.Firm, ta);
                    }
                    else if (this.Parameters.Length.Equals(3))
                    {
                        lblTA.Text                = this.Parameters[0];
                        lblBienvenido.Text        = this.Parameters[1];
                        lblInformacion.Text       = this.Parameters[2];
                        lblStateConection.Visible = false;
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(activeBanner))
                    {
                        activeBanner = ParameterBL.GetParameterValue("ActiveBanner").Values;
                    }
                    if (Convert.ToBoolean(activeBanner))
                    {
                        try
                        {
                            if (BannerImageList != null)
                            {
                                if (BannerImageList.Count.Equals(0))
                                {
                                    BannerImageList = GetBannerImageBL.GetBannerImageList("1");
                                }
                                if (BannerImageList.Count > 0)
                                {
                                    SetDinamicImages();
                                }
                            }
                        }
                        catch
                        { }
                    }
                }
            }
            catch { }
        }
コード例 #3
0
        public static List <BannerImage> GetBannerImageList(int index)
        {
            if (bannerImageList == null)
            {
                bannerImageList = new List <BannerImage>();
                bannerImageList = GetBannerImageBL.GetBannerImageList(index.ToString());
            }

            return(bannerImageList);
        }