private void button1_Click(object sender, EventArgs e) { if (dataGridView1.CurrentCell.RowIndex >= 0) { Merchant_Service.finishDeliver(Order_Service.GetDeliverOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex]); } }
public deliverForm(Merchant merchant) { this.currentMerchant = merchant; bindingSource1 = new BindingSource(); InitializeComponent(); bindingSource1.DataSource = Order_Service.GetDeliverOrderList(currentMerchant); //typeBindingSource.DataSource = currentMerchant.CuisineTypes; bindingSource1.ResetBindings(false); bindingSource2.DataSource = bindingSource1.Current; //orderList = Order_Service.GetOrderList(); }
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); }
private void dataGridView1_MouseClick(object sender, MouseEventArgs e) { bindingSource2.DataSource = Order_Service.GetDeliverOrderList(currentMerchant)[dataGridView1.CurrentCell.RowIndex].OrderItems; bindingSource2.ResetBindings(false); }