Exemple #1
0
        private void FormShrink_Load(object sender, EventArgs e)
        {
            try
            {
                var inventoryTableAdapter       = new VoucherExpense.DamaiDataSetTableAdapters.InventoryTableAdapter();
                var productTableAdapter         = new VoucherExpense.DamaiDataSetTableAdapters.ProductTableAdapter();
                var ProductScrappedTableAdapter = new VoucherExpense.DamaiDataSetTableAdapters.ProductScrappedTableAdapter();
                productTableAdapter.Connection.ConnectionString = DB.SqlConnectString(MyFunction.HardwareCfg);

                inventoryTableAdapter.Fill(Inventory);
                productTableAdapter.Fill(Product);
                ProductScrappedTableAdapter.Fill(ProductScrapped);
                InventoryData();
            }
            catch (Exception ex)
            {
                MessageBox.Show(" " + ex.Message);
            }
        }
Exemple #2
0
        private void FormIngredientInventories_Load(object sender, EventArgs e)
        {
            SetupBindingSource();
            dgvInventories.DataSource     = inventoryBindingSource;
            dgvInventoryDetail.DataSource = fKInventoryDetailInventoryBindingSource;
            dgvProducts.DataSource        = fKInventoryProductsInventoryBindingSource;
            var productAdapter    = new VoucherExpense.DamaiDataSetTableAdapters.ProductTableAdapter();
            var operatorAdapter   = new VoucherExpense.DamaiDataSetTableAdapters.OperatorTableAdapter();
            var ingredientAdapter = new VoucherExpense.DamaiDataSetTableAdapters.IngredientTableAdapter();

            productAdapter.Connection.ConnectionString    = DB.SqlConnectString(MyFunction.HardwareCfg);
            operatorAdapter.Connection.ConnectionString   = DB.SqlConnectString(MyFunction.HardwareCfg);
            ingredientAdapter.Connection.ConnectionString = DB.SqlConnectString(MyFunction.HardwareCfg);

            try
            {
                productAdapter.Fill(m_OrderSet.Product);
                operatorAdapter.Fill(m_DataSet.Operator);
                ingredientAdapter.Fill(m_DataSet.Ingredient);

                InventoryAdapter.Fill(m_DataSet.Inventory);
                InventoryDetailAdapter.Fill(m_DataSet.InventoryDetail);
                InventoryProductsAdapter.Fill(m_DataSet.InventoryProducts);
            }
            catch (Exception ex)
            {
                MessageBox.Show("錯誤訊息:" + ex.Message);
            }
            ColumnLocked.ReadOnly = !MyFunction.LockInventory;
            if (MyFunction.LockInventory)
            {
                dgvColumnCurrentIn.Visible       = true;
                dgvColumnLostMoney.Visible       = true;
                dgvColumnPrevStockVolume.Visible = true;
            }
            else
            {
                dgvColumnCurrentIn.Visible       = false;
                dgvColumnLostMoney.Visible       = false;
                dgvColumnPrevStockVolume.Visible = false;
            }
            //            tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;
        }