Beispiel #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}");
        }
Beispiel #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"])})");
        }
Beispiel #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);
        }
Beispiel #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}");
        }
Beispiel #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})");
        }
Beispiel #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})");
        }
Beispiel #7
0
        //Author: Jesper


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

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

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