Exemple #1
0
        public CustomersOrders[] GetOrderData() //פונקציה לאחסון  רשימת הזמנות של כל הלקוחות
        {
            DataSet   ds     = new DataSet();
            ArrayList Order  = new ArrayList();
            string    cmdStr = "SELECT * FROM   [CustomersOrders]";

            using (OleDbCommand command = new OleDbCommand(cmdStr))
            {
                ds = GetMultiplyQuery(command);
            }
            DataTable dt = new DataTable();

            try
            {
                dt = ds.Tables[0];
            }
            catch { }
            foreach (DataRow tType in dt.Rows)
            {
                CustomersOrders CusOrder = new CustomersOrders();
                CusOrder.CustomersOrders_ID         = int.Parse(tType[0].ToString());
                CusOrder.CustomersOrders_ClientID   = int.Parse(tType[1].ToString());
                CusOrder.CustomersOrders_ClientName = tType[2].ToString();
                CusOrder.CustomersOrders_OrderSuppliedToCustomer = bool.Parse(tType[3].ToString());
                CusOrder.CustomersOrders_Date           = DateTime.Parse(tType[4].ToString());
                CusOrder.CustomerOrders_Price           = double.Parse(tType[5].ToString());
                CusOrder.CustomersOrders_WorkerApproved = tType[6].ToString();


                Order.Add(CusOrder);
            }
            return((CustomersOrders[])Order.ToArray(typeof(CustomersOrders)));
        }
Exemple #2
0
        public void UpdateOrderReceivedInCustomersOrders(CustomersOrders cusorder)//פונקציה שמעדכנת שהלקוח קיבל את הזמנתו בטבלת הזמנות כלליות
        {
            string cmdStr = "UPDATE CustomersOrders SET Order_Supplied_To_Customer=@Order_Supplied_To_Customer WHERE OrderID=" + cusorder.CustomersOrders_ID;

            using (OleDbCommand command = new OleDbCommand(cmdStr))
            {
                command.Parameters.AddWithValue("@Order_Supplied_To_Customer", cusorder.CustomersOrders_OrderSuppliedToCustomer);
                base.ExecuteSimpleQuery(command);
            }
        }
Exemple #3
0
        public void UpdateCustomerNameInCustomerOrders(Customers cus, CustomersOrders cusorder)//פונקציה לעדכון שם של  לקוח בטבלת סיכום הזמנות במידה והלקוח שינה את שמו
        {
            string cmdStr = "UPDATE CustomersOrders SET CustomerName=" + cusorder.CustomersOrders_ClientName + " WHERE CustomerID=" + cus.Customer_ID;

            using (OleDbCommand command = new OleDbCommand(cmdStr))
            {
                command.Parameters.AddWithValue("@First_Name", cusorder.CustomersOrders_ClientName);
                base.ExecuteSimpleQuery(command);
            }
        }
Exemple #4
0
        public void RemoveCustomersOrder(CustomersOrders CusOrder)//פונקציה למחיקת פרטי הזמנה בטבלת סיכום הזמנות
        {
            string cmdStr = "DELETE  FROM CustomersOrders WHERE OrderID = @OrderID";

            using (OleDbCommand command = new OleDbCommand(cmdStr))
            {
                command.Parameters.AddWithValue("@OrderID", CusOrder.CustomersOrders_ID);
                command.Parameters.AddWithValue("@CustomerID", CusOrder.CustomersOrders_ClientID);
                command.Parameters.AddWithValue("@CustomerName", CusOrder.CustomersOrders_ClientName);

                base.ExecuteSimpleQuery(command);
            }
        }
Exemple #5
0
        public void AddCustomerOrder(CustomersOrders CusOrder)//פונקציה להוספת הזמנה למאגר ההזמנות
        {
            string cmdStr = "INSERT INTO CustomersOrders (OrderID,CustomerID,CustomerName,Order_Supplied_To_Customer,OrderDate,OrderPrice,WorkerApproved) VALUES (@OrderID,@CustomerID,@CustomerName,@Order_Supplied_To_Customer,@OrderDate,@OrderPrice,@WorkerApproved)";

            using (OleDbCommand command = new OleDbCommand(cmdStr))
            {
                command.Parameters.AddWithValue("@OrderID", CusOrder.CustomersOrders_ID);
                command.Parameters.AddWithValue("@CustomerID", CusOrder.CustomersOrders_ClientID);
                command.Parameters.AddWithValue("@CustomerName", CusOrder.CustomersOrders_ClientName);
                command.Parameters.AddWithValue("@Order_Supplied_To_Customer", CusOrder.CustomersOrders_OrderSuppliedToCustomer);
                command.Parameters.AddWithValue("@OrderDate", CusOrder.CustomersOrders_Date);
                command.Parameters.AddWithValue("@OrderPrice", CusOrder.CustomerOrders_Price);
                command.Parameters.AddWithValue("@WorkerApproved", CusOrder.CustomersOrders_WorkerApproved);
                base.ExecuteSimpleQuery(command);
            }
        }