public void DeleteProductInOrder() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Delete_Product_In_order @Order_ID, @Product_ID "; c.Parameters.AddWithValue("@Order_ID", this.orderFromSupplier.getID()); c.Parameters.AddWithValue("@Product_ID", this.productInOrder.get_productID()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void createProductInCourse() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Add_Products_In_Courses @Course_Number, @Product_ID, @Quantity"; c.Parameters.AddWithValue("@Course_Number", this.course.get_Coursenumber()); c.Parameters.AddWithValue("@Product_ID", this.product.get_productID()); c.Parameters.AddWithValue("@Quantity", this.quantity); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void createCustomerInCourse() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Add_CUSTOMERS_In_Course @Course_Number, @Customer_ID"; c.Parameters.AddWithValue("@Course_Number", this.course.get_Coursenumber()); c.Parameters.AddWithValue("@Customer_ID", this.customer.get_customerID()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void UpdateProductInPurchase() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Update_Products_In_Purchase @Purchase_ID, @Product_ID, @Quantity"; c.Parameters.AddWithValue("@Product_ID", this.product.get_productID()); c.Parameters.AddWithValue("@Purchase_ID", this.purchase.getID()); c.Parameters.AddWithValue("@Quantity", this.quantity); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void createPromocode() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Add_Promo_Code @Promo_Code_Name, @Promo_Description, @Promo_Start_Date, @Promo_Discount_Percent,@Promo_End_Date"; c.Parameters.AddWithValue("@Promo_Code_Name", this.promoName); c.Parameters.AddWithValue("@Promo_Description", this.promoDescription); c.Parameters.AddWithValue("@Promo_Start_Date", this.promoStartDate); c.Parameters.AddWithValue("@Promo_Discount_Percent", this.promoDiscountPercent); c.Parameters.AddWithValue("@Promo_End_Date", this.promoEndDate); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void create_supplier() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Add_Suppliers @Supplier_ID, @Supplier_Name, @Supplier_Phone, @Supplier_Email, @Supplier_Address, @Supplier_Description"; c.Parameters.AddWithValue("@Supplier_ID", this.supplierID); c.Parameters.AddWithValue("@Supplier_Name", this.supplierName); c.Parameters.AddWithValue("@Supplier_Phone", this.supplierPhone); c.Parameters.AddWithValue("@Supplier_Email", this.supplierEmail); c.Parameters.AddWithValue("@Supplier_Address", this.supplierAddress); c.Parameters.AddWithValue("@Supplier_Description", this.supplierDescription); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void update_purchase() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Update_Purchase @Purchase_ID, @Purchase_Price, @Purchase_By_Employee, @Purchase_By_Customer, @Purchase_Date, @Payment_Method, @Purchase_Promo_Code"; c.Parameters.AddWithValue("@Purchase_ID", this.purchaseID); c.Parameters.AddWithValue("@Purchase_Price", this.purchasePrice); c.Parameters.AddWithValue("@Purchase_By_Employee", this.purchaseByEmployee.get_employeeID()); c.Parameters.AddWithValue("@Purchase_By_Customer", this.purchaseByCustomer.get_customerID()); c.Parameters.AddWithValue("@Purchase_Date", this.purchaseDate); c.Parameters.AddWithValue("@Payment_Method", this.paymentMethod.ToString()); c.Parameters.AddWithValue("@Purchase_Promo_Code", this.purchasePromoCode.getPromoName()); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void update_Course() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Update_Course @Course_Number, @Course_Name, @Course_Date_Time, @Course_Lecturer_Name, @Course_Lecturer_Phone, @Participant_Price, @Cost_To_Company, @Curse_Location, @Curse_Description "; c.Parameters.AddWithValue("@Course_Number", this.courseNumber); c.Parameters.AddWithValue("@Course_Name", this.courseName); c.Parameters.AddWithValue("@Course_Date_Time", this.courseDateTime); c.Parameters.AddWithValue("@Course_Lecturer_Name", this.courseLecturerName); c.Parameters.AddWithValue("@Course_Lecturer_Phone", this.LecturerPhone); c.Parameters.AddWithValue("@Participant_Price", this.participantPrice); c.Parameters.AddWithValue("@Cost_To_Company", this.costToCompany); c.Parameters.AddWithValue("@Curse_Location", this.courseLocation); c.Parameters.AddWithValue("@Curse_Description", this.courseDescription); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
//CRU FUNCTIONS: public void create_orderFromSupplier() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Add_Orders_From_Supplier @Order_ID, @Order_Date, @Order_Due_Date, @Order_Total_Price, @Payment_Method, @Order_Status, @Employee_Makes, @Supllier_receives, @Description";//-------check Employee and supplier c.Parameters.AddWithValue("@Order_ID", this.orderID); c.Parameters.AddWithValue("@Order_Date", this.orderDate); c.Parameters.AddWithValue("@Order_Due_Date", this.orderDueDate); c.Parameters.AddWithValue("@Order_Total_Price", this.orderTotalPrice); c.Parameters.AddWithValue("@Payment_Method", this.paymentMethod.ToString()); c.Parameters.AddWithValue("@Order_Status", this.orderStatus.ToString()); c.Parameters.AddWithValue("@Employee_Makes", this.employeeMakes.get_employeeID()); c.Parameters.AddWithValue("@Supllier_receives", this.supplier.get_supplierID()); c.Parameters.AddWithValue("@Description", this.Description); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void createCustomer() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Add_Customer @Customer_ID, @Customer_FirstName, @Customer_LastName, @Customer_Gender, @Customer_Phone, @Customer_Email, @Customer_Birth_Date, @Customer_Address, @Customer_Member_Club"; c.Parameters.AddWithValue("@Customer_ID", this.customerID); c.Parameters.AddWithValue("@Customer_FirstName", this.customerFirstName); c.Parameters.AddWithValue("@Customer_LastName", this.customerLastName); c.Parameters.AddWithValue("@Customer_Gender", this.customerGender.ToString()); c.Parameters.AddWithValue("@Customer_Phone", this.customerPhone); c.Parameters.AddWithValue("@Customer_Email", this.customerEmail); c.Parameters.AddWithValue("@Customer_Birth_Date", this.customerBirthDate); c.Parameters.AddWithValue("@Customer_Address", this.customerAddress); c.Parameters.AddWithValue("@Customer_Member_Club", this.customerMemberClub); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }
public void update_product() { SqlCommand c = new SqlCommand(); c.CommandText = "EXECUTE dbo.SP_Update_Product @Product_ID, @Product_Name, @Product_Supplier, @Product_Supplier_Price,@Product_Sale_Price , @Product_Category, @Product_Description, @Product_Quantity, @Product_Lower_Bound, @Closet_Num, @Shelf_Num"; c.Parameters.AddWithValue("@Product_ID", this.productID); c.Parameters.AddWithValue("@Product_Name", this.productName); c.Parameters.AddWithValue("@Product_Supplier", this.productSupplier.get_supplierID()); c.Parameters.AddWithValue("@Product_Supplier_Price", this.productSupplierPrice); c.Parameters.AddWithValue("@Product_Sale_Price", this.productSalePrice); c.Parameters.AddWithValue("@Product_Category", this.productCategory.ToString()); c.Parameters.AddWithValue("@Product_Description", this.productDescription); c.Parameters.AddWithValue("@Product_Quantity", this.productQuantity); c.Parameters.AddWithValue("@Product_Lower_Bound", this.productLowerBound); c.Parameters.AddWithValue("@Closet_Num", this.closetNum); c.Parameters.AddWithValue("@Shelf_Num", this.shelfNum); SQL_CON SC = new SQL_CON(); SC.execute_non_query(c); }