Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public OrderUI(Inventory _i)
        {
            try
            {
                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                iManager = (InventoryManager)ctx.GetObject("InventoryManager");
                oManager = (OrderManager)ctx.GetObject("OrderManager");

                newOrder     = new Order();
                curInventory = _i;
                bDialog      = new BurritoDialog(curInventory);
            }
            catch (Exception e)
            {
                dLog.Debug("Exception | Unable to initialize business layer components: " + e.Message + "\n" + e.StackTrace);
            }

            InitializeComponent();

            // Initialize the DataGridView.
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.AutoSize            = true;

            // Initialize columns
            DataGridViewColumn column = new DataGridViewTextBoxColumn();

            column.DataPropertyName = "#";
            column.Name             = "#";
            dataGridView1.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Type";
            column.Name             = "Type";
            dataGridView1.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Price";
            column.Name             = "Price";
            dataGridView1.Columns.Add(column);
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView1.ReadOnly            = true;

            this.AutoSize = true;
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        public OrderUI(Inventory _i)
        {
            try
            {
                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                iManager = (InventoryManager)ctx.GetObject("InventoryManager");
                oManager = (OrderManager)ctx.GetObject("OrderManager");

                newOrder = new Order();
                curInventory = _i;
                bDialog = new BurritoDialog(curInventory);
            }
            catch (Exception e)
            {
                dLog.Debug("Exception | Unable to initialize business layer components: " + e.Message + "\n" + e.StackTrace);
            }

            InitializeComponent();

            // Initialize the DataGridView.
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.AutoSize = true;

            // Initialize columns
            DataGridViewColumn column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "#";
            column.Name = "#";
            dataGridView1.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Type";
            column.Name = "Type";
            dataGridView1.Columns.Add(column);

            column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "Price";
            column.Name = "Price";
            dataGridView1.Columns.Add(column);
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView1.ReadOnly = true;

            this.AutoSize = true;
        }