예제 #1
0
        public DataTable getTHELOAI()
        {
            DATABASE  diaphim = new DATABASE();
            DataTable tab     = new DataTable();

            tab = diaphim.getData("spr_get_THELOAI", null);
            diaphim.closeConnection();
            return(tab);
        }
예제 #2
0
        public DataTable getnNGUOIDUNG()
        {
            DATABASE  diaphim = new DATABASE();
            DataTable tab     = new DataTable();

            tab = diaphim.getData("spr_get_users", null);
            diaphim.closeConnection();
            return(tab);
        }
예제 #3
0
        public DataTable searchSANPHAM(string valueToSearch)
        {
            DATABASE  diaphim = new DATABASE();
            DataTable table   = new DataTable();

            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0]       = new SqlParameter("@val", SqlDbType.VarChar, 100);
            parameters[0].Value = valueToSearch;
            table = diaphim.getData("spr_search_SANPHAM", parameters);
            diaphim.closeConnection();
            return(table);
        }
예제 #4
0
        public DataTable getSANPHAMbyTHELOAI(int t_id)
        {
            DATABASE  diaphim = new DATABASE();
            DataTable table   = new DataTable();

            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0]       = new SqlParameter("@ST_ID", SqlDbType.Int);
            parameters[0].Value = t_id;
            table = diaphim.getData("spr_SANPHAM_by_THELOAI", parameters);
            diaphim.closeConnection();
            return(table);
        }
예제 #5
0
        public DataTable getSANPHAM(int id)
        {
            DATABASE  diaphim = new DATABASE();
            DataTable tab     = new DataTable();

            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0]       = new SqlParameter("@ID", SqlDbType.Int);
            parameters[0].Value = id;
            tab = diaphim.getData("spr_get_SANPHAM_by_id", parameters);
            diaphim.closeConnection();
            return(tab);
        }
예제 #6
0
        public DataTable login(string username, string password)
        {
            DATABASE diaphim = new DATABASE();

            SqlParameter[] param = new SqlParameter[2];
            param[0]       = new SqlParameter("@username", SqlDbType.VarChar, 20);
            param[0].Value = username;
            param[1]       = new SqlParameter("@pass", SqlDbType.VarChar, 20);
            param[1].Value = password;
            DataTable tab = new DataTable();

            tab = diaphim.getData("spr_DANGNHAP", param);
            diaphim.closeConnection();
            return(tab);
        }
예제 #7
0
 public FormTHELOAI()
 {
     InitializeComponent();
     table = diaphim.getData("spr_THELOAI_SANPHAM", null);
     dataGridView1.DataSource = table;
     try
     {
         listBox1.DataSource    = sp.getSANPHAMbyTHELOAI(Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value.ToString()));
         listBox1.DisplayMember = "NAME";
         listBox1.ValueMember   = "ID";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }