Beispiel #1
0
        private void Login()
        {
            bool login = false; // 로그인 상태 false

            //string strName = "";

            // 데이터베이스 연결
            dbc.Connection();

            memId = tbId.Text;
            // tbID에 입력된 값으로 데이터 찾기
            string str = "select * from MemLogin where MemId='" + memId + "'";

            dbc.Command(str);
            dbc.DataReader(ref login);


            // 로그인 상태가 true일 때
            if (login)
            {
                MessageBox.Show(dbc.strName + "님이 로그인합니다.");

                this.Visible = false;
                BookListForm blf = new BookListForm();
                blf.ShowDialog();

                this.Visible = true;
                tbId.Text    = "";
                tbPw.Text    = "";
                root         = 0;
            }
            // 로그인 상태가 false일 때
            else
            {
                MessageBox.Show("아이디와 비밀번호를 확인하여 주세요.");
            }
        }
Beispiel #2
0
        public BookListForm()
        {
            InitializeComponent();
            blf = this;
            Search();

            dgvBookList.CellMouseClick   += dgvBookList_CellMouseClick;     // 셀 선택
            dgvBookList.CellValueChanged += dgvBookList_CellValueChanged;   // 셀 변경

            if (LoginForm.root == 1)
            {
                btnDel.Visible   = true;
                btnInput.Visible = true;
                btnSave.Visible  = true;
                btnRent.Visible  = false;
            }
            else
            {
                btnDel.Visible   = false;
                btnInput.Visible = false;
                btnSave.Visible  = false;
                btnRent.Visible  = true;
            }
        }