DataTable ICustomerContext.GetCustomerByID(int CustomerID)
        {
            string query = "SELECT * FROM [Customer] WHERE ID = @CustID";
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@CustID", CustomerID)
            };

            return(SQL_CRUD_Methods.SQLReadParameterized(query, parameters));
        }
        DataTable IInvoiceContext.GetInvoiceByID(int InvoiceID)
        {
            string query = "SELECT* FROM Invoice WHERE ID = @InvID";
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@InvID", InvoiceID)
            };

            return(SQL_CRUD_Methods.SQLReadParameterized(query, parameters));
        }
Beispiel #3
0
        DataTable IEmployeeContext.GetEmployeeByID(int EmployeeID)
        {
            string query = "SELECT * FROM Employee WHERE ID = @EmpID";
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@EmpID", EmployeeID)
            };

            return(SQL_CRUD_Methods.SQLReadParameterized(query, parameters));
        }
Beispiel #4
0
        DataTable IRentableContext.GetRentableByID(int RentableID)
        {
            string query = "SELECT * FROM Rentable WHERE ID = @RentID";
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@RentID", RentableID)
            };

            return(SQL_CRUD_Methods.SQLReadParameterized(query, parameters));
        }
        void IInvoiceContext.ChangeInvoiceStatus(int InvoiceID, string NewStatus)
        {
            string query = "UPDATE Invoice SET Status = @Status , LastChangeDate = @DateTime   WHERE ID = @InvoiceID";
            List <KeyValuePair <string, object> > parameters = new List <KeyValuePair <string, object> >
            {
                new KeyValuePair <string, object>("@Status", NewStatus),
                new KeyValuePair <string, object>("@InvoiceID", InvoiceID),
                new KeyValuePair <string, object>("@DateTime", DateTime.Now)
            };

            SQL_CRUD_Methods.SQLUpdate(query, parameters);
        }
        DataTable IInvoiceContext.GetAllInvoices()
        {
            string query = "SELECT * FROM Invoice";

            return(SQL_CRUD_Methods.SQLReadNonParameter(query));
        }
        DataTable ICustomerContext.GetAllCustomers()
        {
            string query = "Select * FROM [Customer]";

            return(SQL_CRUD_Methods.SQLReadNonParameter(query));
        }
Beispiel #8
0
        DataTable IEmployeeContext.GetAllEmployees()
        {
            string query = "SELECT * FROM Employee";

            return(SQL_CRUD_Methods.SQLReadNonParameter(query));
        }
Beispiel #9
0
        DataTable IRentableContext.GetAllRentables()
        {
            string query = "SELECT * FROM Rentable";

            return(SQL_CRUD_Methods.SQLReadNonParameter(query));
        }