private void loadForm(DTO_CUser user, int selectIndex)
 {
     this.mainTabControl.SelectedIndex = 1;
     this.lb_username.Text             = user.TenNV;
     this.lb_role_name.Text            = user.RoleName + " :";
     this.lb_user_id.Text = user.MaNV;
 }
Exemple #2
0
 public frm_TinhTien(DTO_CUser currentUserLogin, DataTable tableProduct, String billID)
 {
     this.currentUserLogin = currentUserLogin;
     this.tableProduct     = tableProduct;
     this.billID           = billID;
     InitializeComponent();
     this.lb_total_price.Text = String.Format("{0:#,##}", this.loadTotalPrice());
 }
Exemple #3
0
        public frm_BanHang(DTO_CUser currentLoginUser)
        {
            this.currentLoginUser = currentLoginUser;
            InitializeComponent();

            this.loadBillID();
            this.loadGrvProductSearch("");
            this.tbProductBuy = new DataTable();
            this.tbProductBuy.Columns.Add("MSMH");
            this.tbProductBuy.Columns.Add("TENMH");
            this.tbProductBuy.Columns.Add("SOLUONG");
            this.tbProductBuy.Columns.Add("THANHTIEN");
        }
 private void userLogin()
 {
     if (this.checkValid())
     {
         DTO_CUser user = new DTO.DTO_CUser(this.txtUsername.Text, this.txtPassword.Text);
         this.loginedUser = new BUS_USER().userLogin(user);
         if (loginedUser != null)
         {
             loadForm(loginedUser, 0);
         }
         else
         {
             MessageBox.Show("Đăng nhập không thành công", "SUccess !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
        public DTO_CUser userLogin(DTO_CUser user)
        {
            DTO_CUser getUser = null;

            String     queryString = "pr_userLogin";
            SqlCommand command     = new SqlCommand(queryString, DAL_CDBConnect.myconn);

            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add("@username", System.Data.SqlDbType.VarChar).Value = user.TenDangNhap;
            command.Parameters.Add("@password", System.Data.SqlDbType.VarChar).Value = user.MatKhau;

            SqlDataReader result = command.ExecuteReader();

            while (result.Read())
            {
                getUser = new DTO_CUser(result["MANV"].ToString(), result["TENNV"].ToString(), user.TenDangNhap, result["DIENTHOAI"].ToString(), int.Parse(result["ROLE"].ToString()), result["ROLENAME"].ToString());
            }

            result.Close();
            command.Dispose();
            return(getUser);
        }
 public frmHethong()
 {
     InitializeComponent();
     loginedUser = null;
     this.txtUsername.Focus();
 }