public void DisplayInfo(TextBox ho, TextBox ten, TextBox soTaiKhoan, TextBox loaiTK, TextBox soDu)
        {
            SqlCommand cmd = new SqlCommand("sp_GetInfoAllUser");

            cmd.CommandType = CommandType.StoredProcedure;

            DataTable dt       = m_taikhoan.OpenDataSet(cmd).Tables[0];
            int       numofRow = dt.Rows.Count;

            string mathe = GlobalVariable.mathe;
            string sothedt;

            for (int i = 0; i < numofRow; i++)
            {
                sothedt = (string)dt.Rows[i][0];
                if (sothedt == mathe)
                {
                    ho.Text         = (string)dt.Rows[i][1];
                    ten.Text        = (string)dt.Rows[i][2];
                    soTaiKhoan.Text = (string)dt.Rows[i][3];
                    loaiTK.Text     = (string)dt.Rows[i][4];
                    soDu.Text       = (dt.Rows[i][5]).ToString();
                    return;
                }
            }
        }
Exemplo n.º 2
0
        public void loadData(TextBox txtsoDu)
        {
            SqlCommand cmd = new SqlCommand("sp_GetInfoAllUser");

            cmd.CommandType = CommandType.StoredProcedure;

            DataTable dt = m_dangnhap.OpenDataSet(cmd).Tables[0];

            string sothedt;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sothedt = (string)dt.Rows[i][0];
                if (GlobalVariable.mathe == sothedt)
                {
                    txtsoDu.Text = (dt.Rows[i][5]).ToString();
                }
            }
        }
Exemplo n.º 3
0
        public void loadData(DataGridView dtgv)
        {
            SqlCommand cmd = new SqlCommand("sp_xemGiaoDich");
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@sotk", SqlDbType.NVarChar, 20).Value = GlobalVariable.sotaikhoan;

            DataTable dt = m_ketnoi.OpenDataSet(cmd).Tables[0];
            dtgv.DataSource = dt;
        }
Exemplo n.º 4
0
        public string getSoThe(TextBox txtsothe, TextBox txtpass)
        {
            SqlCommand cmd = new SqlCommand("sp_GetAllUser");

            cmd.CommandType = CommandType.StoredProcedure;
            string sothe = txtsothe.Text.ToString();
            string pass  = txtpass.Text.ToString();

            DataTable dt = m_dangnhap.OpenDataSet(cmd).Tables[0];
            string    sothedt, passworddt;
            int       numofRow = dt.Rows.Count;

            for (int i = 0; i < numofRow; i++)
            {
                passworddt = (string)dt.Rows[i][0];
                sothedt    = (string)dt.Rows[i][1];

                if (sothedt == sothe && passworddt == pass)
                {
                    return(sothedt);
                }
            }
            return("");
        }