//확인버튼을 눌렀을 때
        private void buttonConfirmClicked(object sender, EventArgs e)
        {
            string   id    = textBoxPasswdID.Text;
            string   name  = textBoxPasswdName.Text;
            DateTime date  = dateTimePickerBirth.Value.Date;
            string   birth = date.Year + "-" + date.Month + "-" + date.Day;

            if (name != "")
            {
                oracleCommand1.CommandText = "select consu_password from consumer where consu_id='" + id + "' AND consu_name='" + name + "' AND consu_birth=TO_DATE('" + birth + "', 'YYYY-MM-DD')";
                OracleDataReader rdr = oracleCommand1.ExecuteReader();
                int flag             = 0;
                while (rdr.Read())
                {
                    FormChangePasswordData searchFrm = new FormChangePasswordData(mainform, "고객", id, rdr[0].ToString());
                    searchFrm.Owner = this;
                    searchFrm.Show();
                    this.Visible = false;
                    flag++;
                }
                oracleConnection1.Close();
                if (flag == 0)
                {
                    MessageBox.Show("해당하는 정보의 사용자가 없습니다.");
                }
            }
            else
            {
                MessageBox.Show("모든 값을 입력해 주세요");
            }
        }
Ejemplo n.º 2
0
        private void buttonConfirmClick(object sender, EventArgs e)
        {
            string id   = textBoxPasswdID.Text;
            string name = textBoxPasswdName.Text;

            if (name != "")
            {
                switch (mode)
                {
                case "직원":
                    oracleCommand1.CommandText = "select employ_password from employee where employ_id='" + id + "' AND employ_name='" + name + "'";
                    break;

                case "관리자":
                    oracleCommand1.CommandText = "select admin_password from administer where admin_id='" + id + "' AND admin_name='" + name + "'";
                    break;
                }
                OracleDataReader rdr = oracleCommand1.ExecuteReader();
                int flag             = 0;
                while (rdr.Read())
                {
                    FormChangePasswordData frm = new FormChangePasswordData(mainform, mode, id, rdr[0].ToString());
                    frm.Owner = this;
                    frm.Show();
                    this.Visible = false;
                    flag++;
                }
                oracleConnection1.Close();
                if (flag == 0)
                {
                    MessageBox.Show("해당하는 정보의 사용자가 없습니다.");
                }
            }
            else
            {
                MessageBox.Show("모든 값을 입력해 주세요");
            }
        }