Example #1
0
        // Properties
        internal Order NewOrder
        {
            get { return newOrder; }
            set { newOrder = value; }
        }

        public OrderForm()
        {
            InitializeComponent();

            // This application will only work with one order at a time.  Only create if there is no order present
            if (MainForm.Orders.Count == 0)
            {
                // Create a new 'Order' object
                newOrder = new Order();
                // Add the order to the main form 'Order' array to reuse
                MainForm.Orders.Add(newOrder);

 
            }
            else
            {
                newOrder = MainForm.Orders.ElementAt(0);
            }

            // Loads all listed items based on enumerations within class types
            loadOrderFormLists();

            // Bind the order list to the 'Order List' form listbox
            orderList.DataSource = newOrder.OrderList;
            //orderList.DisplayMember = "ProductType";
Example #2
0
    

    public partial class CustomerInfoForm : Form
    {
        public MainForm mainForm;
        public static Customer customer;