예제 #1
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);
 }
예제 #2
0
 public DataTable getallinfo() {
     string query = string.Format("SELECT * FROM ban");
     try {
         con = new DbConnection();
         con.openConnection();
     }
     catch (SqlException e) { }
     return con.executeSelectQuery(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);
 }
 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);
 }