示例#1
0
        //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}");
        }
示例#2
0
        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"])})");
        }
示例#3
0
        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);
        }
示例#4
0
        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}");
        }
示例#5
0
        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})");
        }
示例#6
0
        //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})");
        }
示例#7
0
        //Author: Jesper


        public void CreateOrder(int customerID)
        {
            Sql_Connection sqlCon = new Sql_Connection();

            sqlCon.ExecuteSql($"insert into Ordre(customerID) Values ({customerID})");
        }
示例#8
0
        public void DeleteProductLine(int productLineID)
        {
            Sql_Connection sqlCon = new Sql_Connection();

            sqlCon.ExecuteSql($"DELETE FROM ProductLine where productLineID = {productLineID}");
        }
示例#9
0
        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}");
        }
示例#10
0
        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})");
        }