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)); }
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)); }
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)); }
DataTable IEmployeeContext.GetAllEmployees() { string query = "SELECT * FROM Employee"; return(SQL_CRUD_Methods.SQLReadNonParameter(query)); }
DataTable IRentableContext.GetAllRentables() { string query = "SELECT * FROM Rentable"; return(SQL_CRUD_Methods.SQLReadNonParameter(query)); }