Exemplo n.º 1
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            if (txtId.Text == "" || txtFullname.Text == "" || txtPassword.Text == "" || txtRight.Text == "" || txtId.Text == "")
            {
                MessageBox.Show("Vui  lòng nhập đầy đủ thông tin ", "thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
            }
            else
            {
                //tạo đói tượng phòng ban để gán dữ  liệu
                Account_DTO a = new Account_DTO();
                a.Id       = txtId.Text;
                a.Username = txtUsername.Text;
                a.Fullname = txtFullname.Text;
                a.Password = txtPassword.Text;
                a.Right    = txtRight.Text;

                Acount_BUS.Delete_ac(a);
                if (Acount_BUS.Delete_ac(a) == true)
                {
                    MessageBox.Show("Xóa thành công!");
                    dgv_manageAccount.Refresh();
                    return;
                }
                MessageBox.Show("Xóa thất bại ");
            }
        }
Exemplo n.º 2
0
        private void btn_find_Click(object sender, EventArgs e)
        {
            if (txtId.Text == "")
            {
                MessageBox.Show("Nhập user  cần tìm kiếm!", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            }
            Account_DTO a = new Account_DTO();

            a.Id = txtId.Text.ToString();
            List <Account_DTO> list = Acount_BUS.Load_Acount_find(a);

            dgv_manageAccount.DataSource = list;
            if (list == null)
            {
                MessageBox.Show("user  bạn tìm kiếm không tồn tại ", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.None);
            }
        }
Exemplo n.º 3
0
        public void frmqlhanghoa_Load(object sender, EventArgs e)
        {
            List <Account_DTO> list = Acount_BUS.Load_Account();

            dgv_manageAccount.DataSource = list;
        }