Ejemplo n.º 1
0
        public ORDERS addNewDelivery(int orderNumber)
        {
            DELIVERY_Manager dem    = new DELIVERY_Manager(Configuration);
            ORDERS           orders = ORDERS_DB.GetORDERS(orderNumber);

            orders.Fk_Id_Delivery = dem.createNewDelivery();

            return(ORDERS_DB.UpdateORDERS_Fk_Id_Delivery(orders));
        }
Ejemplo n.º 2
0
        public ORDERS cancelOrders(string [] stab)
        {
            ORDERS orders = ORDERS_DB.GetORDERS(stab);

            orders.Fk_Id_Order_Status = 16;

            DELIVERY_DB dm       = new DELIVERY_DB(Configuration);
            DELIVERY    delivery = dm.GetDELIVERY(orders.Fk_Id_Delivery);

            delivery.Fk_Id_Delivery_Status = 16;
            dm.UpdateDELIVERY_Fk_Id_Delivery_Status(delivery);

            return(ORDERS_DB.UpdateORDERS_Fk_Id_Order_Status(orders));
        }
Ejemplo n.º 3
0
        public ORDERS cancelOrders(int orderNumber)
        {
            ORDERS orders = ORDERS_DB.GetORDERS(orderNumber);

            orders.Fk_Id_Order_Status = 9;

            DELIVERY_DB dm       = new DELIVERY_DB(Configuration);
            DELIVERY    delivery = dm.GetDELIVERY(orders.Fk_Id_Delivery);

            delivery.Fk_Id_Delivery_Status = 9;
            dm.UpdateDELIVERY_Fk_Id_Delivery_Status(delivery);

            return(ORDERS_DB.UpdateORDERS_Fk_Id_Order_Status(orders));
        }
Ejemplo n.º 4
0
        public DELIVERY archiveDelivery(int deliveryNumber)
        {
            DELIVERY delivery = DELIVERY_DB.GetDELIVERY(deliveryNumber);

            DELIVERY_DB.UpdateDELIVERY_Finish_Time(delivery);

            delivery.Fk_Id_Delivery_Status = 15;
            ORDERS_DB om     = new ORDERS_DB(Configuration);
            ORDERS    orders = om.GetORDERS(DELIVERY_DB.GetORDERSid(deliveryNumber));

            orders.Fk_Id_Order_Status = 7;

            om.UpdateORDERS_Fk_Id_Order_Status(orders);

            return(DELIVERY_DB.UpdateDELIVERY_Fk_Id_Delivery_Status(delivery));
        }
Ejemplo n.º 5
0
        public ORDERS addNewBills(int orderNumber)
        {
            BILLS_Manager bm     = new BILLS_Manager(Configuration);
            ORDERS        orders = ORDERS_DB.GetORDERS(orderNumber);

            orders.Fk_Id_Bills        = bm.createNewBills(orderNumber);
            orders.Fk_Id_Order_Status = 2;

            DELIVERY_DB dm       = new DELIVERY_DB(Configuration);
            DELIVERY    delivery = dm.GetDELIVERY(orders.Fk_Id_Delivery);

            delivery.Fk_Id_Delivery_Status = 2;
            dm.UpdateDELIVERY_Fk_Id_Delivery_Status(delivery);
            ORDERS_DB.UpdateORDERS_Fk_Id_Bills(orders);
            return(ORDERS_DB.UpdateORDERS_Fk_Id_Order_Status(orders));
        }
        public int createNewBills(int orderNumber)
        {
            ORDERS_DISHES_DB odm = new ORDERS_DISHES_DB(Configuration);
            ORDERS_DB        om  = new ORDERS_DB(Configuration);

            SERVICE_CLASS_DB scm = new SERVICE_CLASS_DB(Configuration);
            DELIVERY_DB      dm  = new DELIVERY_DB(Configuration);

            ORDERS orders = om.GetORDERS(orderNumber);

            BILLS bills = new BILLS();

            bills.Amount = odm.GetAmount(orders) + scm.GetAmount(dm.GetDELIVERY(orders.Fk_Id_Delivery));
            bills        = BILLS_DB.AddBILLS(bills);
            return(bills.Id);
        }
Ejemplo n.º 7
0
        public ORDERS confirmOrders(int orderNumber)
        {
            ORDERS orders = ORDERS_DB.GetORDERS(orderNumber);

            orders.Fk_Id_Order_Status = 4;

            BILLS_DB bm    = new BILLS_DB(Configuration);
            BILLS    bills = bm.GetBILLS(orders.Fk_Id_Bills);

            bm.UpdateBILLS_Payment_Date(bills);

            DELIVERY_DB dm       = new DELIVERY_DB(Configuration);
            DELIVERY    delivery = dm.GetDELIVERY(orders.Fk_Id_Delivery);

            delivery.Fk_Id_Delivery_Status = 4;
            dm.UpdateDELIVERY_Fk_Id_Delivery_Status(delivery);

            return(ORDERS_DB.UpdateORDERS_Fk_Id_Order_Status(orders));
        }
Ejemplo n.º 8
0
 public int createNewOrders(int customerNumber)
 {
     return(ORDERS_DB.AddORDERS(customerNumber));
 }
Ejemplo n.º 9
0
 public ORDERS_Manager(IConfiguration configuration)
 {
     ORDERS_DB     = new ORDERS_DB(configuration);
     Configuration = configuration;
 }
Ejemplo n.º 10
0
 public List <ORDERS> displayOrders(int customerNumber)
 {
     return(ORDERS_DB.GetORDERSForCustomer(customerNumber));
 }
        public BILLS displayBills(int orderNumber)
        {
            ORDERS_DB om = new ORDERS_DB(Configuration);

            return(BILLS_DB.GetBILLS(om.GetORDERS(orderNumber).Fk_Id_Bills));
        }