コード例 #1
0
ファイル: OrderUI.cs プロジェクト: bloomj/BurritoPOS_CSharp
        /// <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>
        /// <param name="_i"></param>
        public InventoryUI(Inventory _i)
        {
            try
            {
                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                iManager = (InventoryManager)ctx.GetObject("InventoryManager");

                rand = new Random();
                curInventory = _i;
            }
            catch (Exception e)
            {
                dLog.Debug("Exception | Unable to initialize Inventory UI: " + e.Message + "\n" + e.StackTrace);
            }

            InitializeComponent();

            setDefaultValues();
        }
コード例 #3
0
ファイル: MainUI.cs プロジェクト: bloomj/BurritoPOS_CSharp
        /// <summary>
        /// 
        /// </summary>
        public MainUI()
        {
            try
            {
                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                iManager = (InventoryManager)ctx.GetObject("InventoryManager");

                rand = new Random();
                i = new Inventory(rand.Next(), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250));
                iManager.createInventory(i);
            }
            catch (Exception e)
            {
                dLog.Debug("Exception | Unable to create Inventory: " + e.Message + "\n" + e.StackTrace);
            }

            InitializeComponent();

            this.IsMdiContainer = true;
        }
コード例 #4
0
        protected void SetUp()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            dLog.Info("Beginning InventoryManagerTestCase Setup");
            rand = new Random();

            try {
                //iManager = new InventoryManager();
                //oManager = new OrderManager();

                //Spring.NET
                XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
                iManager = (InventoryManager)ctx.GetObject("InventoryManager");
                oManager = (OrderManager)ctx.GetObject("OrderManager");

                i = new Inventory(rand.Next(), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250), rand.Next(10, 250));
                o = new Order(rand.Next(), new List<Burrito>(), new DateTime(), false, false, new Decimal(0));
                b = new Burrito(rand.Next(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), nextBool(), new Decimal(rand.NextDouble()));
            }
            catch (Exception e)
            {
                dLog.Error("Unable to initialize service/domain objects: " + e.Message + "\n" + e.StackTrace);
            }
            dLog.Info("Finishing InventoryManagerTestCase Setup");
        }