Ejemplo n.º 1
0
        private void guna2GradientButton1_Click_1(object sender, EventArgs e)
        {
            string userName, pass, manv, role;

            if (tbMa.Text.StartsWith(" ") || tbPass.Text.StartsWith(" ") || tbTen.Text.StartsWith(" ") || tbRole.Text.StartsWith(" "))
            {
                MessageBox.Show("Bạn Chưa Điền đủ thông tin");
            }
            else
            {
                userName = tbTen.Text;
                pass     = tbPass.Text;
                manv     = tbMa.Text;
                role     = tbRole.Text;
                DTO.Account acc = new DTO.Account(userName, pass, role, manv);
                if (_accBll.AddUser(acc))
                {
                    MessageBox.Show("Thêm  Success");
                    LoadingAcc();
                }
                else
                {
                    MessageBox.Show("Thêm Fail!");
                }
            }
        }
Ejemplo n.º 2
0
        public void FillAccount()
        {
            string userName, pass, manv, role;

            if (tbMaNV.Text.StartsWith(" ") || tbPassWord.Text.StartsWith(" ") || tbUsser.Text.StartsWith(" "))
            {
                MessageBox.Show("Bạn Chưa Điền đủ thông tin");
            }
            else
            {
                userName = tbUsser.Text;
                pass     = tbPassWord.Text;
                manv     = tbMaNV.Text;
                role     = "User";
                DTO.Account acc = new DTO.Account(userName, pass, role, manv);
                _accBll.AddUser(acc);
            }
        }