예제 #1
0
        public int insertHouse(string houseToInsert)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("insert into houses (code, aria, rooms, bathrooms, cityzone, address, price, description, " +
                                   "type, pic, status, datein, employee) values (" + houseToInsert + ")"));
        }
예제 #2
0
        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)"));
        }
예제 #3
0
        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)"));
        }
예제 #4
0
        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);
        }
예제 #5
0
        public int deleteClient(int clientID)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("delete from clients where id = " + clientID));
        }
예제 #6
0
        public DataTable getClientsNeedConnectToHouse()
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecReader("select * from clients c where type <> 3"));
        }
예제 #7
0
        public int joinHouseToClient(int houseID, int clientID)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("update houses set client = " + clientID + " where id = " + houseID));
        }
예제 #8
0
        public DataTable getEmployees()
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecReader("select * from employees"));
        }
예제 #9
0
        public int insertClient(string clientToInsert)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("insert into clients (fullname, phone, email, type) values (" + clientToInsert + ")"));
        }
예제 #10
0
        public int updateHouse(int houseID, string houseToUpdate)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("update houses set " + houseToUpdate + " where id = " + houseID));
        }
예제 #11
0
        public int insertSale(string saleToInsert)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("insert into sales (empcommision, lastprice, saledate, house, employee) values (" + saleToInsert + ")"));
        }
예제 #12
0
        public DataTable getMessages()
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecReader("select * from messages"));
        }
예제 #13
0
        public int deleteHouse(int houseID)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("delete from houses where id = " + houseID));
        }
예제 #14
0
        public int deleteMessage(int messageID)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("delete from messages where id = " + messageID));
        }
예제 #15
0
        public int updateClient(int clientID, string clientToUpdate)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("update clients set " + clientToUpdate + " where id = " + clientID));
        }
예제 #16
0
        public int insertMessage(string messageToInsert)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("insert into messages (employee, message) values (" + messageToInsert + ")"));
        }
예제 #17
0
        public DataTable getMessages(int agentID)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecReader("select * from messages where employee = " + agentID));
        }
예제 #18
0
        public int deleteEmployee(int employeeID)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("delete from employees where id = " + employeeID));
        }
예제 #19
0
        public int updateEmployee(int employeeID, string employeeToUpdate)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("update employees set " + employeeToUpdate + " where id = " + employeeID));
        }
예제 #20
0
        public int insertEmployee(string employeeToInsert)
        {
            clsDBconnection db = new clsDBconnection();

            return(db.ExecNonQuery("insert into employees (code, fullname, gender, lang, cityzone, type, username, [password], pic) values (" + employeeToInsert + ")"));
        }