Пример #1
0
        public void cancelOrder()
        {
            int cancelOrder = Order_Service.GetWaitCancelOrderList(currentMerchant).Count;

            if (cancelOrder > cancelOrder1)
            {
                textBox1.Text += "注意啦!有客户要取消订单!\r\n";
            }
            cancelOrder2 = cancelOrder;
            Thread.Sleep(5000);
        }
Пример #2
0
 public waitCancelForm(Merchant merchant)
 {
     this.currentMerchant = merchant;
     bindingSource1       = new BindingSource();
     InitializeComponent();
     bindingSource1.DataSource = Order_Service.GetWaitCancelOrderList(currentMerchant);
     //typeBindingSource.DataSource = currentMerchant.CuisineTypes;
     bindingSource1.ResetBindings(false);
     bindingSource2.DataSource = bindingSource1.Current;
     //orderList = Order_Service.GetOrderList();
 }
Пример #3
0
        public void newOrder()
        {
            int waitOrder2   = Order_Service.GetOrderList(currentMerchant).Count;
            int cancelOrder2 = Order_Service.GetWaitCancelOrderList(currentMerchant).Count;

            if (waitOrder2 + cancelOrder2 > waitOrder1 + cancelOrder1)
            {
                textBox1.Text += "您有新的订单啦!\r\n";
            }
            waitOrder1   = waitOrder2;
            cancelOrder1 = waitOrder2;
            Thread.Sleep(5000);
        }
Пример #4
0
        public Form1(Merchant merchant)
        {
            this.currentMerchant = merchant;
            this.mof             = new Manage_Order_Form(merchant);
            this.wcf             = new waitCancelForm(merchant);
            this.af = new acceptedForm(merchant);
            //this.cf = new cancelForm(merchant);
            this.df           = new deliverForm(merchant);
            this.ff           = new finishForm(merchant);
            this.finishOrder1 = Order_Service.GetFinishOrderList(merchant).Count;
            this.waitOrder1   = Order_Service.GetOrderList(merchant).Count;
            this.cancelOrder1 = Order_Service.GetWaitCancelOrderList(merchant).Count;
            System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer();
            timer1.Interval = 3000;
            timer1.Tick    += new System.EventHandler(timer1_Tick);
            timer1.Start();


            InitializeComponent();
        }
Пример #5
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            int waitOrder2   = Order_Service.GetOrderList(currentMerchant).Count;
            int cancelOrder2 = Order_Service.GetWaitCancelOrderList(currentMerchant).Count;

            if (waitOrder2 + cancelOrder2 > waitOrder1 + cancelOrder1)
            {
                textBox1.Text += $"{DateTime.Now.ToLocalTime().ToString()}:您有新的订单啦!\r\n";
            }
            //int cancelOrder = Order_Service.GetWaitCancelOrderList(currentMerchant).Count;
            if (cancelOrder2 > cancelOrder1)
            {
                textBox1.Text += $"{DateTime.Now.ToLocalTime().ToString()}:注意啦!有客户要取消订单!\r\n";
            }
            waitOrder1   = waitOrder2;
            cancelOrder1 = cancelOrder2;

            int finishOrder = Order_Service.GetFinishOrderList(currentMerchant).Count;

            if (finishOrder > finishOrder1)
            {
                textBox1.Text += $"{DateTime.Now.ToLocalTime().ToString()}:订单已完成!\r\n";
            }
            finishOrder1 = finishOrder;
            //更新mof
            mof.bindingSource1.DataSource = Order_Service.GetOrderList(currentMerchant);
            mof.bindingSource1.ResetBindings(false);
            if (mof.dataGridView3.Rows.Count <= 1)
            {
                mof.bindingSource2.DataSource = mof.bindingSource1.Current;
            }
            //mof.bindingSource2.DataSource = mof.bindingSource1.Current;
            //更新wcf
            wcf.bindingSource1.DataSource = Order_Service.GetWaitCancelOrderList(currentMerchant);
            wcf.bindingSource1.ResetBindings(false);
            if (wcf.dataGridView1.Rows.Count <= 1)
            {
                wcf.bindingSource2.DataSource = wcf.bindingSource1.Current;
            }
            //wcf.bindingSource2.DataSource = wcf.bindingSource1.Current;

            //更新af
            af.bindingSource1.DataSource = Order_Service.GetAcceptedOrderList(currentMerchant);
            af.bindingSource1.ResetBindings(false);
            if (af.dataGridView1.Rows.Count <= 1)
            {
                af.bindingSource2.DataSource = af.bindingSource1.Current;
            }
            //af.bindingSource2.DataSource = af.bindingSource1.Current;
            //更新df
            df.bindingSource1.DataSource = Order_Service.GetDeliverOrderList(currentMerchant);
            df.bindingSource1.ResetBindings(false);
            if (df.dataGridView1.Rows.Count <= 1)
            {
                df.bindingSource2.DataSource = df.bindingSource1.Current;
            }
            //df.bindingSource2.DataSource = df.bindingSource1.Current;
            //更新ff
            ff.bindingSource1.DataSource = Order_Service.GetFinishOrderList(currentMerchant);
            ff.bindingSource1.ResetBindings(false);
        }
Пример #6
0
 private void dataGridView1_MouseClick(object sender, MouseEventArgs e)
 {
     bindingSource2.DataSource = Order_Service.GetWaitCancelOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex].OrderItems;
     bindingSource2.ResetBindings(false);
 }
Пример #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     Merchant_Service.acceptCancel(Order_Service.GetWaitCancelOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex]);
 }