Ejemplo n.º 1
0
        private void EditInventoryManagement_Load(object sender, EventArgs e)
        {
            XuLy.getTransactionTypes(cbbTransactionType);
            XuLy.getSuppliers(cbbSuppliers);
            XuLy.getWarehouses(cbbSourceWarehouse);
            XuLy.getWarehouses(cbbDestinationWarehouse);
            XuLy.getParts(cbbPartName);
            InventoryManagementView viewOld = Program.oldEdit;

            cbbTransactionType.SelectedValue = viewOld.TransactionTypeID;
            if (viewOld.TransactionTypeID == 1)
            {
                cbbSuppliers.SelectedValue       = viewOld.SupplierID;
                cbbSourceWarehouse.Enabled       = false;
                cbbSourceWarehouse.SelectedIndex = -1;
            }
            else
            {
                cbbSourceWarehouse.SelectedValue = viewOld.SourceWarehouseID;
                cbbSuppliers.Enabled             = false;
                cbbSuppliers.SelectedIndex       = -1;
            }
            cbbDestinationWarehouse.SelectedValue = viewOld.DestinationWarehouseID;
            cbbPartName.SelectedValue             = viewOld.PartID;
            dtpDate.Value       = viewOld.Date;
            txtAmount.Text      = viewOld.Amount.ToString();
            txtBatchNumber.Text = viewOld.BatchNumber;
        }