public DataTable getHousesNeedConnectToClient(int?agentID = null) { clsDBconnection db = new clsDBconnection(); return(db.ExecReader("select * from houses h where " + (agentID != null ? "employee = " + agentID + " and " : "") + " not exists (select * from clients where type <> 3 and id = h.client)")); }
public DataTable getHousesForSales(int?agentID) { clsDBconnection db = new clsDBconnection(); return(db.ExecReader("select * from houses h where " + (agentID != null ? "employee = " + agentID + " and " : "") + " status = 3 and not exists (select * from sales where house = h.id)")); }
public DataRow getClient(int clientID) { clsDBconnection db = new clsDBconnection(); DataTable tmp = db.ExecReader("select * from clients where type <> 3 and id = " + clientID); if (tmp.Rows.Count != 0) { return(tmp.Rows[0]); } return(null); }
public DataTable getClientsNeedConnectToHouse() { clsDBconnection db = new clsDBconnection(); return(db.ExecReader("select * from clients c where type <> 3")); }
public DataTable getEmployees() { clsDBconnection db = new clsDBconnection(); return(db.ExecReader("select * from employees")); }
public DataTable getMessages() { clsDBconnection db = new clsDBconnection(); return(db.ExecReader("select * from messages")); }
public DataTable getMessages(int agentID) { clsDBconnection db = new clsDBconnection(); return(db.ExecReader("select * from messages where employee = " + agentID)); }