public void deleteItem(Item item) { DBModifier modder = new DBModifier(); modder.modifyRows("DELETE FROM \"Vendor_Items\"" + " WHERE \"ItemID\" = '" + item.ItemID + "'"); modder.modifyRows("DELETE FROM \"Item\"" + " WHERE \"ItemID\" = '" + item.ItemID + "'"); }
public void deleteUser(User user) { DBModifier modder = new DBModifier(); modder.modifyRows("DELETE FROM \"User\"" + " WHERE \"ID\" = '" + user.ID + "'"); modder.modifyRows("DELETE FROM \"Login\"" + " WHERE \"ID\" = '" + user.ID + "'"); }
public void addItemToVendor(int vendorID, int itemID) { DBModifier modder = new DBModifier(); modder.modifyRows("INSERT INTO \"Vendor_Items\"(\"VedndorID\",\"ItemID\") VALUES(' " + itemID + "'," + vendorID + "')"); }
public void addVendor(Vendor theVendor) { DBModifier modder = new DBModifier(); modder.modifyRows("INSERT INTO \"Vendor\"(\"VendorName\", \"VendorAdress\") VALUES('" + theVendor.VendorName + "','" + theVendor.VendorAddress + "')"); }
public void addUser(User theUser, int loginId) { DBModifier modder = new DBModifier(); modder.modifyRows("INSERT INTO \"User\"(\"ID\", \"FirstName\", \"LastName\", \"Email\", \"PhoneNumber\", \"DateOfBirth\", \"IsAdmin\", \"Gender\", \"Address\") VALUES('" + loginId + "','" + theUser.FirstName + "','" + theUser.LastName + "','" + theUser.Email + "','" + theUser.PhoneNumber + "','" + theUser.DateOfBirth.Date + "','" + theUser.IsAdmin + "','" + theUser.Gender + "','" + theUser.Address + "')"); }
public void changeLogin(Login theLogin) { DBModifier modder = new DBModifier(); modder.modifyRows("UPDATE \"Login\" SET " + "\"UserName\" = '" + theLogin.UserName + "'," + "\"Password\" = '" + theLogin.Password + "'" + " WHERE \"ID\" = '" + theLogin.ID + "'"); }
public void saveItemList(List <ItemList> itemLists) { DBModifier modder = new DBModifier(); foreach (ItemList i in itemLists) { modder.modifyRows("INSERT INTO \"ItemList\" (\"OrderID\", \"ItemID\", \"Quantity\") VALUES ('" + i.OrderID + "','" + i.ItemID + "','" + i.Quantity + "')"); } }
public void changeItem(Item theItem) { DBModifier modder = new DBModifier(); modder.modifyRows("UPDATE \"Item\" SET " + "\"StockQuantity\" = " + theItem.StockQuantity + "," + "\"ItemName\" = '" + theItem.ItemName + "'," + "\"CostPrice\" = " + theItem.CostPrice + "," + "\"RetailPrice\" = " + theItem.RetailPrice + "" + " WHERE \"ItemID\" = '" + theItem.ItemID + "'"); }
public void addItem(Item theItem, Vendor theVendor) { DBModifier modder = new DBModifier(); DBSelector selector = new DBSelector(); //put the item in the DB modder.modifyRows("INSERT INTO \"Item\"(\"RetailPrice\",\"StockQuantity\",\"ItemName\",\"CostPrice\",\"Category\") VALUES(" + theItem.RetailPrice + "," + theItem.StockQuantity + ",'" + theItem.ItemName + "'," + theItem.CostPrice + ",'" + theItem.Category + "')"); Item newitem = selector.getRow <Item>("SELECT * FROM \"Item\" WHERE \"RetailPrice\" = " + theItem.RetailPrice + " AND \"StockQuantity\" = " + theItem.StockQuantity + " AND \"ItemName\" = '" + theItem.ItemName + "' AND \"CostPrice\" = " + theItem.CostPrice + " AND \"Category\" = '" + theItem.Category + "'"); //add it to the vedor modder.modifyRows("INSERT INTO \"Vendor_Items\"(\"VendorID\",\"ItemID\") VALUES( " + theVendor.VendorID + "," + newitem.ItemID + ")"); }
public int saveLoginInfo(string username, string password) { DBModifier modder = new DBModifier(); modder.modifyRows("INSERT INTO \"Login\" (\"UserName\", \"Password\") VALUES ('" + username + "','" + password + "')"); DBSelector selector = new DBSelector(); Login newLogin = selector.getRow <Login>("SELECT * FROM \"Login\" WHERE " + "\"UserName\" = '" + username + "' AND \"Password\" = '" + password + "'"); return(newLogin.ID); }
public void changeUser(User theUser) { DBModifier modder = new DBModifier(); modder.modifyRows("UPDATE \"User\" SET " + "\"FirstName\" = '" + theUser.FirstName + "'," + "\"LastName\" = '" + theUser.LastName + "'," + "\"Email\" = '" + theUser.Email + "'," + "\"PhoneNumber\" = '" + theUser.PhoneNumber + "'," + "\"DateOfBirth\" = '" + theUser.DateOfBirth.Date + "'," + "\"IsAdmin\" = '" + theUser.IsAdmin + "'," + "\"Gender\" = '" + theUser.Gender + "'," + "\"Address\" = '" + theUser.Address + "'" + " WHERE \"ID\" = '" + theUser.ID + "'"); }
public void setPassword(int loginID, string password) { DBModifier modder = new DBModifier(); modder.modifyRows("UPDATE \"Login\" SET \"Password\" = " + password + " WHERE \"ID\" = '" + loginID + "'"); }