Example #1
0
        private void lstSideDish_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Cs_sideDish sideDish = (Cs_sideDish)lstSideDish.SelectedItem;

            EditDish((IDishBean)sideDish, RestaurantBL.DishTypeEnum.SIDE_DISH);
            cmbDishType.Enabled   = false;
            cmdAddDish.Enabled    = false;
            cmdUpdateDish.Enabled = true;
        }
        private void lstSideDish_MouseClick(object sender, MouseEventArgs e)
        {
            Cs_sideDish sideDish1 = null;
            Cs_sideDish sideDish2 = null;

            if (lstSideDish.IndexFromPoint(e.Location) < 0)
            {
                return;
            }

            if (lstSideDish.SelectedItems.Count > 2)
            {
                if (((Cs_sideDish)lstSideDish.SelectedItems[0]).SideDishId == 1)
                {
                    lstSideDish.SetSelected(0, false);
                }
                else if (((Cs_sideDish)lstSideDish.SelectedItems[1]).SideDishId == 1)
                {
                    lstSideDish.SetSelected(0, false);
                }
            }

            switch (lstSideDish.SelectedItems.Count)
            {
            case 0:
                sideDish1 = (Cs_sideDish)lstSideDish.Items[0];
                sideDish2 = (Cs_sideDish)lstSideDish.Items[0];
                break;

            case 1:
                sideDish1 = (Cs_sideDish)lstSideDish.SelectedItem;
                sideDish2 = (Cs_sideDish)lstSideDish.Items[0];
                break;

            case 2:
                sideDish1 = (Cs_sideDish)lstSideDish.SelectedItems[0];
                sideDish2 = (Cs_sideDish)lstSideDish.SelectedItems[1];
                break;

            default:
                ShowMessage(7);
                lstSideDish.SetSelected(lstSideDish.IndexFromPoint(e.Location), false);
                return;
            }

            bl.AddSideDishOrder(sideDish1, sideDish2);
            lblSum.Text           = bl.OrderSum.ToString();
            lblSideDishPrice.Text = (sideDish1.DishPrice + sideDish2.DishPrice).ToString();
        }
Example #3
0
 partial void UpdateCs_sideDish(Cs_sideDish instance);
Example #4
0
 partial void DeleteCs_sideDish(Cs_sideDish instance);
Example #5
0
 partial void InsertCs_sideDish(Cs_sideDish instance);