Beispiel #1
0
        public ReservationFrm()
        {
            InitializeComponent();

            numInterval.Value = 3;

            gboption.Enabled = gbReservation.Enabled = gbSite.Enabled = gboption.Enabled = false;

            IList <string> cookie = HttpManager.GetCoockie();

            _cookieString = cookie[0] + "," + cookie[1].Replace("Path=/", "") + cookie[2];

            //textBox1.Focus();
            textBox1.Select();

            worker.ProgressChanged    += worker_ProgressChanged;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
        }
Beispiel #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string resultHtml = HttpManager.Login(textBox1.Text, textBox2.Text, _cookieString);

            if (resultHtml.Contains("<div class=\"login_error\">"))
            {
                const string searchText = "<div class=\"login_error\">";
                string       resultText =
                    resultHtml.Substring(resultHtml.IndexOf(searchText) + searchText.Length,
                                         resultHtml.IndexOf("</p>", resultHtml.IndexOf(searchText)) - resultHtml.IndexOf(searchText) -
                                         searchText.Length)
                    .Replace("<p>", "")
                    .Replace("<strong>", "")
                    .Replace("</strong>", "")
                    .Trim();
                MessageBox.Show(resultText);
                Logging(textBox1.Text + " 아이디 로그인 에러 ", resultText);
                return;
            }
            else
            {
                resultHtml = HttpManager.GetMain(_cookieString);
                const string searchText = "<span class=\"name\">";
                string       resultText =
                    resultHtml.Substring(resultHtml.IndexOf(searchText) + searchText.Length,
                                         resultHtml.IndexOf("</span>", resultHtml.IndexOf(searchText)) - resultHtml.IndexOf(searchText) -
                                         searchText.Length)
                    //.Replace("<p>", "")
                    //.Replace("<strong>", "")
                    //.Replace("</strong>", "")
                    .Trim();
                Logging(textBox1.Text + " 로그인", resultText, Color.Blue);
                _userName = resultText;

                toolStripStatusLabel1.Text = _userName + @" 로그인";
            }


            gboption.Enabled = gbReservation.Enabled = gbSite.Enabled = gboption.Enabled = true;

            cbLodge.DataSource    = HttpManager.GetForestLodge(_cookieString);
            cbLodge.ValueMember   = "Code";
            cbLodge.DisplayMember = "Name";

            //lbReservation.DisplayMember = "Desc";
            cbReservation.DisplayMember = "Desc";

            var data = new[]
            {
                new { Value = "1", Name = "1박2일" },
                new { Value = "2", Name = "2박3일" },
                new { Value = "3", Name = "3박4일" }
            };

            cbPeriod.DataSource    = data;
            cbPeriod.ValueMember   = "Value";
            cbPeriod.DisplayMember = "Name";


            cbLodge.SelectedValueChanged    += cbLodge_SelectedIndexChanged;
            cbFacility.SelectedIndexChanged += CbFacilityOnSelectedIndexChanged;

            gbAccont.Enabled = false;
        }