Esempio n. 1
0
        public DataTable GetListEmployee(string namecol, bool isAscending)
        {
            string  query = "EXEC GetListImployee @namecol , @isA";
            DataSet ds    = db.ExecuteQueryDS(query, CommandType.Text, new object[] { namecol, isAscending });

            return(ds.Tables[0]);
        }
Esempio n. 2
0
        public List <cWork> GetListWork()
        {
            List <cWork> lstwork = new List <cWork>();
            string       query   = "EXEC GetListWork";
            DataSet      ds      = db.ExecuteQueryDS(query, CommandType.Text);
            DataTable    dt      = ds.Tables[0];

            foreach (DataRow item in dt.Rows)
            {
                cWork work = new cWork(item);
                lstwork.Add(work);
            }
            return(lstwork);
        }
Esempio n. 3
0
        public cAccount GetAccount(string username, string pass)
        {
            string  query = "EXEC GetAccount @UserName , @PassWord";
            DataSet ds    = db.ExecuteQueryDS(query, CommandType.Text, new object[] { username, pass });


            if (ds.Tables[0].Rows.Count == 0)
            {
                return(null);
            }
            cAccount account = new cAccount(ds.Tables[0].Rows[0]);

            return(account);
        }
Esempio n. 4
0
        public List <cBillInfo> GetListBillInfo(int idbill)
        {
            List <cBillInfo> ls = new List <cBillInfo>();
            DataSet          ds = db.ExecuteQueryDS("SELECT * FROM dbo.BILLINFO WHERE IDBILL = " + idbill, CommandType.Text);
            DataTable        dt = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                cBillInfo billinfo = new cBillInfo(item);
                ls.Add(billinfo);
            }
            return(ls);
        }
Esempio n. 5
0
        public int GetUnCheckBillID(int idtable)
        {
            DataSet   ds = db.ExecuteQueryDS("EXEC GetUnpaidBillID @idtable", CommandType.Text, new object[] { idtable });
            DataTable dt = new DataTable();

            dt = ds.Tables[0];
            if (dt.Rows.Count > 0)
            {
                DataRow row = dt.Rows[0];
                //cBill bill = new cBill(row);
                return(Convert.ToInt32(row["IDBILL"]));
            }
            return(-1);
        }
Esempio n. 6
0
        public List <cTable> LayDanhSachbBanAn()
        {
            List <cTable> tbl = new List <cTable>();
            DataSet       ds  = db.ExecuteQueryDS("EXEC GetListTable", CommandType.Text);
            DataTable     dt  = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                cTable tb = new cTable(item);

                tbl.Add(tb);
            }
            return(tbl);
        }
Esempio n. 7
0
        public List <cMenu> GetListMenu(int idtable)
        {
            List <cMenu> listMenu = new List <cMenu>();
            string       query    = "EXEC GetListOrder @idtable";
            DataSet      ds       = db.ExecuteQueryDS(query, CommandType.Text, new object[] { idtable });
            DataTable    dt       = new DataTable();

            dt = ds.Tables[0];

            foreach (DataRow item in dt.Rows)
            {
                cMenu menu = new cMenu(item);
                listMenu.Add(menu);
            }
            return(listMenu);
        }
Esempio n. 8
0
        public int GetValueSale(string code)
        {
            int    value = 0;
            string query = "EXEC GetValueSale @code";

            DataSet   ds = db.ExecuteQueryDS(query, CommandType.Text, new object[] { code });
            DataTable dt = new DataTable();

            dt = ds.Tables[0];
            try
            {
                value = Convert.ToInt32(dt.Rows[0]["VALUE"]);
            }
            catch
            {
                value = 0;
            }
            return(value);
        }
Esempio n. 9
0
        public List <cTypeFood> GetListTypeFood()
        {
            List <cTypeFood> lstype = new List <cTypeFood>();
            string           query  = "EXEC GetListFoodType";
            DataSet          ds     = db.ExecuteQueryDS(query, CommandType.Text);
            DataTable        dt     = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                cTypeFood type = new cTypeFood(item);
                lstype.Add(type);
            }
            return(lstype);
        }
Esempio n. 10
0
        public List <cArea> LayDanhSachArea()
        {
            List <cArea> tbl = new List <cArea>();
            DataSet      ds  = db.ExecuteQueryDS("EXEC GetListArea", CommandType.Text);
            DataTable    dt  = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                cArea tb = new cArea(item);

                tbl.Add(tb);
            }
            return(tbl);
        }
Esempio n. 11
0
        public List <cSupplier> GetListSupplier()
        {
            List <cSupplier> lst   = new List <cSupplier>();
            string           query = "EXEC GetListSupplier";
            DataSet          ds    = db.ExecuteQueryDS(query, CommandType.Text);
            DataTable        dt    = new DataTable();

            dt = ds.Tables[0];
            foreach (DataRow item in dt.Rows)
            {
                cSupplier acc = new cSupplier(item);
                lst.Add(acc);
            }

            return(lst);
        }