예제 #1
0
 public DataTable getallinfo() {
     string query = string.Format("SELECT * FROM ban");
     try {
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.executeSelectQuery(query);
 }
예제 #2
0
 public Boolean setinfo(string _tenban, string _tinhtrang, string _khuvuc) {
     string query = string.Format("INSERT INTO ban (tenban, tinhtrang, khuvuc) VALUES ('"+_tenban+"', "+_tinhtrang+", "+_khuvuc+")");
     try{
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.executeQuery(query);
 }
예제 #3
0
 public Boolean updatetinhtranban(string _tinhtrang, string _maban) {
     string query = string.Format("UPDATE ban SET tinhtrang=" + _tinhtrang + " WHERE maban="+ _maban);
     try
     {
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.executeQuery(query);
 }
예제 #4
0
 public SqlDataReader getinfoban(string _id) {
     string query = string.Format("SELECT * FROM ban WHERE maban='"+_id+"'");
     try
     {
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.MyReader(query);
 }
예제 #5
0
 public DataTable getfilterinfo(String _Condition)
 {
     string query = string.Format("SELECT * FROM ban WHERE "+_Condition);
     try
     {
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.executeSelectQuery(query);
 }
예제 #6
0
        public Boolean setinfo(string _tenban, string _tinhtrang, string _khuvuc)
        {
            string query = string.Format("INSERT INTO ban (tenban, tinhtrang, khuvuc) VALUES ('" + _tenban + "', " + _tinhtrang + ", " + _khuvuc + ")");

            try{
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeQuery(query));
        }
예제 #7
0
        public DataTable getallinfo()
        {
            string query = string.Format("SELECT * FROM ban");

            try {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeSelectQuery(query));
        }
 public DataTable getallthucdon()
 {
     string query = string.Format("SELECT thucdon.mamon, thucdon.tenmon, thucdon.gia, loaithucdon.tenloai, thucdon.donvi, thucdon.tinhtrang, thucdon.mota FROM thucdon INNER JOIN loaithucdon ON thucdon.maloai = loaithucdon.maloai");
     try
     {
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.executeSelectQuery(query);
 }
        public Boolean deletecthoadon(string _id)
        {
            string query = string.Format("delete from chitiethoadon where mahoadon = " + _id);

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeQuery(query));
        }
        public Boolean inserthoadon(string _mahoadon, string _maban, string _tinhtrang, string _ngaylap)
        {
            string query = string.Format("INSERT INTO hoadon (mahoadon, maban, tinhtrang, ngaylap) VALUES ('" + _mahoadon + "', " + _maban + ", " + _tinhtrang + ", '" + _ngaylap + "')");

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeQuery(query));
        }
        public SqlDataReader getmahoadon(string maban, string tinhtrang)
        {
            string query = string.Format("SELECT * FROM hoadon WHERE maban=" + maban + " and tinhtrang=" + tinhtrang);

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.MyReader(query));
        }
        public DataTable getallinfo(string a, string b)
        {
            string query = string.Format("select hoadon.mahoadon,thucdon.tenmon,chitiethoadon.soluong,chitiethoadon.thanhtien, hoadon.ngaylap FROM hoadon inner join chitiethoadon ON hoadon.mahoadon = chitiethoadon.mahoadon inner join thucdon ON chitiethoadon.mamon = thucdon.mamon WHERE hoadon.maban = " + a + " and hoadon.tinhtrang = " + b);

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeSelectQuery(query));
        }
        public DataTable getallthucdon()
        {
            string query = string.Format("SELECT thucdon.mamon, thucdon.tenmon, thucdon.gia, loaithucdon.tenloai, thucdon.donvi, thucdon.tinhtrang, thucdon.mota FROM thucdon INNER JOIN loaithucdon ON thucdon.maloai = loaithucdon.maloai");

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeSelectQuery(query));
        }
예제 #14
0
        public Boolean updatetinhtranban(string _tinhtrang, string _maban)
        {
            string query = string.Format("UPDATE ban SET tinhtrang=" + _tinhtrang + " WHERE maban=" + _maban);

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeQuery(query));
        }
예제 #15
0
        public SqlDataReader getinfoban(string _id)
        {
            string query = string.Format("SELECT * FROM ban WHERE maban='" + _id + "'");

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.MyReader(query));
        }
예제 #16
0
        public DataTable getfilterinfo(String _Condition)
        {
            string query = string.Format("SELECT * FROM ban WHERE " + _Condition);

            try
            {
                con = new DbConnection();
                con.openConnection();
            }
            catch (SqlException e) { }
            return(con.executeSelectQuery(query));
        }