Ejemplo n.º 1
0
        private void Form4_Load(object sender, EventArgs e)
        {
            textBox_UserName.Text = LoginForm.idValue;
            //   ProductName = Form2.ProductName;
            string productName = Form2.ProductIsbn;

            label_Addres.Text       = "한진택배";
            label_ProductCount.Text = Form2.ProductCount;
            int countP = sql.Query_Select_DataSet("WHERE Isbn = '" + Form2.ProductIsbn + "'").Tables[0].Rows.Count;

            if (countP != 0)
            {//상품 금액 , 총 결제 금액 label 값을 넣어줌
                string ciar = sql.Query_Select_DataSet("WHERE Isbn = '" + Form2.ProductIsbn + "'").Tables[0].Rows[0]["Cigar"].ToString();
                label_Cigar.Text = (int.Parse(ciar) * int.Parse(Form2.ProductCount)).ToString();
                int total = int.Parse(label_Cigar.Text) * int.Parse(Form2.ProductCount) + 2500;
                label_Total.Text = total.ToString();
            }
            int countU = sqluser.Query_Select_DataSet("WHERE ID = '" + LoginForm.idValue + "'").Tables[0].Rows.Count;

            if (countU != 0)
            {// 고객 정보 자동 입력
                textBox_UserName.Text = sqluser.Query_Select_DataSet("WHERE ID = '" + LoginForm.idValue + "'").Tables[0].Rows[0]["NAME"].ToString();
                textBox_Address.Text  = sqluser.Query_Select_DataSet("WHERE ID = '" + LoginForm.idValue + "'").Tables[0].Rows[0]["ADDRESS"].ToString();
                textBox_Tel.Text      = sqluser.Query_Select_DataSet("WHERE ID = '" + LoginForm.idValue + "'").Tables[0].Rows[0]["TEL"].ToString();
            }
        }
Ejemplo n.º 2
0
 private void button_login_Click(object sender, EventArgs e)
 {//로그인 버튼
     try
     {
         if (textBox_id.Text.Trim() == "" || textBox_pwd.Text.Trim() == "")
         {
             MessageBox.Show("빈칸이 있습니다. 다시 입력해 주세요");
         }
         else
         {
             SqlLogin sqle  = new SqlLogin();
             int      count = sqle.Query_Select_DataSet("WHERE ID = '" + textBox_id.Text + "' and pwd ='" + textBox_pwd.Text + "'").Tables[0].Rows.Count;
             if (count == 1)
             {
                 string strId   = sqle.Query_Select_DataSet("WHERE ID = '" + textBox_id.Text + "' and pwd ='" + textBox_pwd.Text + "'").Tables[0].Rows[0]["ID"].ToString();
                 string strPwd  = sqle.Query_Select_DataSet("WHERE ID = '" + textBox_id.Text + "' and pwd ='" + textBox_pwd.Text + "'").Tables[0].Rows[0]["PWD"].ToString();
                 string strName = sqle.Query_Select_DataSet("WHERE ID = '" + textBox_id.Text + "' and pwd ='" + textBox_pwd.Text + "'").Tables[0].Rows[0]["NAME"].ToString();
                 if (strId == textBox_id.Text && strPwd == textBox_pwd.Text)
                 {
                     if (textBox_id.Text == "1" && textBox_pwd.Text == "1")
                     {
                         MessageBox.Show("운영자님 환영합니다.");
                         Form6 showForm6 = new Form6();
                         showForm6.Show();
                         this.Visible = false;
                     }
                     else
                     {
                         idValue = textBox_id.Text;
                         MessageBox.Show(strName + "님 환영합니다.");
                         // 추가
                         //  Form2 showForm2 = new Form2();
                         ProductListForm showForm2 = new ProductListForm();
                         showForm2.Show();
                         //sql.Id = textBox_id.Text;
                         this.Visible = false;
                     }
                 }
             }
             else
             {
                 MessageBox.Show("로그인 실패");
             }
         }
     }catch (Exception error)
     {
         //MessageBox.Show("로그인 실패");
         MessageBox.Show("" + error);
     }
 }
Ejemplo n.º 3
0
        private void button_Click(object sender, EventArgs e)
        {//구매하기 버튼
            if (LoginForm.idValue == null)
            {
                MessageBox.Show("로그인을 해주세요");
            }
            else
            {
                int index = comboBox_colorSize.SelectedIndex;
                if (index <= -1)
                {
                    MessageBox.Show("선택해주세요");
                }
                else
                {
                    String purchase_size  = ds.Tables[0].Rows[index]["Size"].ToString();
                    String purchase_color = ds.Tables[0].Rows[index]["Color"].ToString();
                    String purchase_count = comboBox_count.SelectedItem as String;
                    String purchase_cigar = ds.Tables[0].Rows[index]["Cigar"].ToString();
                    String total          = (int.Parse(purchase_cigar) * int.Parse(purchase_count) + 2500).ToString();

                    //회원 정보
                    DataSet uds        = uSqp.Query_Select_DataSet("WHERE ID = '" + LoginForm.idValue + "'");
                    int     countU     = uds.Tables[0].Rows.Count;
                    String  tel_inform = uds.Tables[0].Rows[0]["TEL"].ToString();
                    textBox_tel.Text  = tel_inform.Substring(0, 3);
                    textBox_tel1.Text = tel_inform.Substring(4, 4);
                    textBox_tel2.Text = tel_inform.Substring(9, 4);

                    if (countU != 0)
                    {// 로그인이 된 상태라면
                        textBox_user_name.Text     = uds.Tables[0].Rows[0]["NAME"].ToString();
                        textBox__user_address.Text = uds.Tables[0].Rows[0]["ADDRESS"].ToString();
                        textBox__user_memo.Text    = uds.Tables[0].Rows[0]["ADDRESS"].ToString();
                    }

                    label_purchase_name.Text  = product_name;
                    label_purchase_size.Text  = purchase_size;
                    label_purchase_color.Text = purchase_color;
                    label_purchase_count.Text = purchase_count;
                    label_purchase_cigar.Text = purchase_cigar;
                    label_purchase_total.Text = total;
                    //
                    groupBox_purchase.Visible = true;
                }
            }
        }
        public MyInformationForm()
        {
            InitializeComponent();

            label_id.Text = LoginForm.idValue;
            DataSet ds = sql.Query_Select_DataSet("WHERE id = '" + label_id.Text + "'");

            textBox_name.Text    = ds.Tables[0].Rows[0]["NAME"].ToString();
            textBox_address.Text = ds.Tables[0].Rows[0]["ADDRESS"].ToString();
            String tel  = ds.Tables[0].Rows[0]["TEL"].ToString();
            String tel1 = tel.Substring(0, 3);

            textBox_tel2.Text = tel.Substring(4, 4);
            textBox_tel3.Text = tel.Substring(9, 4);
            //textBox_address.Text = ds.Tables[0].Rows[0]["ADDRESS"].ToString();
            //String tel_inform = ds.Tables[0].Rows[0]["TEL"].ToString();
            string[] tell = { "010", "011", "016", "017", "018", "019" };
            comboBox1.Items.AddRange(tell);

            switch (tel1)
            {
            case "010":
                comboBox1.SelectedIndex = 0;
                break;

            case "011":
                comboBox1.SelectedIndex = 1;
                break;

            case "016":
                comboBox1.SelectedIndex = 2;
                break;

            case "017":
                comboBox1.SelectedIndex = 3;
                break;

            case "018":
                comboBox1.SelectedIndex = 4;
                break;

            case "019":
                comboBox1.SelectedIndex = 5;
                break;
            }
        }
Ejemplo n.º 5
0
        public Form5()
        {
            InitializeComponent();
            label_id.Text = LoginForm.idValue;
            DataSet ds = sqlLogin.Query_Select_DataSet("WHERE id = '" + label_id.Text + "'");

            textBox_pwd.Text     = ds.Tables[0].Rows[0]["PWD"].ToString();
            textBox_name.Text    = ds.Tables[0].Rows[0]["NAME"].ToString();
            textBox_address.Text = ds.Tables[0].Rows[0]["ADDRESS"].ToString();
            String tel_inform = ds.Tables[0].Rows[0]["TEL"].ToString();
            String tel1       = tel_inform.Substring(3, 4);
            String tel2       = tel_inform.Substring(7, 4);

            textBox_tel1.Text = tel1;
            textBox_tel2.Text = tel2;
            string[] tel = { "010", "011", "016", "017", "018", "019" };
            comboBox1.Items.AddRange(tel);
            comboBox1.SelectedIndex = 0;
        }