//Delete methods public void DeleteOrder(int orderID) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"DELETE FROM ProductLine where ordreID = {orderID}"); sqlCon.ExecuteSql($"DELETE FROM Ordre where ordreID = {orderID}"); }
public void CreateEyewear(Eyewear e) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"insert into Product(Manufactor,ModelName,Price,CategoryID) Values ('{e.manufactor}','{e.modelName}',{e.price},{e.categoryID})"); sqlCon.PrepareSql("SELECT * FROM Product WHERE ProductID=(SELECT max(productId) FROM Product);"); SqlDataReader sqld = sqlCon.ReadData(); sqld.Read(); sqlCon.ExecuteSql($"insert into Frame(Sex,Shape,Color,Length,productID) Values ('{e.sex}','{e.shape}','{e.color}',{e.length},{Convert.ToInt32(sqld["ProductID"])})"); }
public string DeleteCustomer(int CustomerID) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"DELETE Customer WHERE CustomerID = {CustomerID}"); string confirm = ($"Kundenummer {CustomerID} er slettet!"); return(confirm); }
public void UpdateCustomer(int customerID, string name, string adress, int zipCode) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"Update Customer Set name = '{name}',adress = '{adress}',zipCode = {zipCode} WHERE CustomerID = {customerID}"); }
public void CreateCustomer(Customer k) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"insert into Customer(name, adress, zipcode) Values ('{k.name}','{k.adress}',{k.zipCode})"); }
//ProductLines methods public void CreateProductLine(int orderID, int productID, int quantity) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"INSERT INTO ProductLine(ordreid,productID,quantity) Values ({orderID},{productID},{quantity})"); }
//Author: Jesper public void CreateOrder(int customerID) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"insert into Ordre(customerID) Values ({customerID})"); }
public void DeleteProductLine(int productLineID) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"DELETE FROM ProductLine where productLineID = {productLineID}"); }
public void UpdateProduct(int ProductID, string Manufactor, string ModelName, double price) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"Update Product Set Manufactor = '{Manufactor}',ModelName = '{ModelName}',price = {price} WHERE ProductID = {ProductID}"); }
public void CreateProduct(Product p) { Sql_Connection sqlCon = new Sql_Connection(); sqlCon.ExecuteSql($"insert into Product(Manufactor,ModelName,Price,CategoryID) Values ('{p.manufactor}','{p.modelName}',{p.price},{p.categoryID})"); }