/// <summary> /// Button:Add Item /// </summary> private void button1_Click(object sender, EventArgs e) { if (this.listBox1.SelectedIndex != -1) { RestaurantViewModel.Send(this.listBox1.SelectedItem.ToString(), "addItem", null); OrderingForm of = new OrderingForm(false); of.BindingGuestOrderId = Convert.ToInt32(this.listBox1.SelectedItem.ToString()); of.ShowDialog(this); } }
/// <summary> /// Button:Create Order /// </summary> private void button3_Click(object sender, EventArgs e) { var execId = RestaurantViewModel.CreateBussinessObjectInstance(); GuestOrderEntity gOrder = new GuestOrderEntity(execId); RestaurantViewModel.RestaurantEntity.GuestOrderList.Add(gOrder); RestaurantViewModel.executorDict[execId].go(); OrderingForm of = new OrderingForm(true); of.BindingGuestOrderId = gOrder.OrderId; of.ShowDialog(this); }