Ejemplo n.º 1
0
        private void bt_Login_Click(object sender, EventArgs e)
        {
            NhanVien    objnhanvien = new NhanVien();
            NhanVienBUS busnhanvien = new NhanVienBUS();

            if (txt_tendangnhap.Text != "" && txt_matkhau.Text != "")
            {
                objnhanvien.tendangnhap = txt_tendangnhap.Text;
                objnhanvien.matkhau     = txt_matkhau.Text;
                //ma hoa
                objnhanvien.matkhau = busnhanvien.Mahoa(objnhanvien);

                check = busnhanvien.LogIn(objnhanvien, check);

                if (check == "True") //phai la True mới dc, con true la ko dc
                {
                    MessageBox.Show("Chào mừng bạn");

                    // mo form ke tiep (AM_Main_Form)
                    AM_Main_Form SGF_Form = new AM_Main_Form();
                    SGF_Form.CheckTenDangNhap(txt_tendangnhap.Text.ToString());
                    SGF_Form.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Sai tên hoặc mật khẩu");
                }
            }
            else
            {
                MessageBox.Show("Bạn vui lòng điền đầy đủ tên đăng nhập và mật khẩu", "Thông Báo");
            }
        }
Ejemplo n.º 2
0
        private void bt_Add_Dev_Click(object sender, EventArgs e)
        {
            if (txt_Serial.Text != "" && txt_Serial.Text != null)
            {
                string message = "";
                ViewToObj();
                message = busDevices.Insert_Form(objDevices, message); // lấy ra message từ proc của sql
                MessageBox.Show(message + " " + txt_Serial.Text);

                if (chk_addmore.Checked == true)
                {
                    txt_Serial.Clear();
                }
                else
                {
                    cleartxt();
                }

                // add qua form AM_Main_Form
                AM_Main_Form SGF_Form = new AM_Main_Form();
                SGF_Form.UpdateForm("update");
                SGF_Form.Refesh_dtgv();

                RefreshDtgvCallback();
            }
            else
            {
                MessageBox.Show("Please Fill Serial Numbers");
            }
        }