Exemplo n.º 1
0
 public void populateEditInfo(VW_InventoryBagLocation storage)
 {
     cboStorageType.SelectedValue = storage.StorageTypeId;
     cboStorage.SelectedValue     = storage.StorageId;
     tbLocation.Text = storage.LocationTag;
     nudBagQty.Value = storage.BagQuantity;
 }
Exemplo n.º 2
0
        private void dgvBagLocations_DoubleClick(object sender, EventArgs e)
        {
            VW_InventoryBagLocation selectedLocation = (VW_InventoryBagLocation)dgvBagLocations.Rows[dgvBagLocations.CurrentRow.Index].DataBoundItem;

            My.MyProject.Forms.FrmAddEditBagInventoryLocation.loadForm();
            My.MyProject.Forms.FrmAddEditBagInventoryLocation.populateEditInfo(selectedLocation);
            MdlLoadingSetting.showDialogForm(My.MyProject.Forms.FrmAddEditBagInventoryLocation, this);
        }
Exemplo n.º 3
0
 private void cboBagLocation_SelectedIndexChanged(object sender, EventArgs e)
 {
     bagLocationInfo   = (VW_InventoryBagLocation)cboBagLocation.SelectedItem;
     lblRemaining.Text = bagLocationInfo.BagQuantity.ToString();
     lblQtyUsed.Text   = nudQuantity.Value.ToString();
     if ((focusedRow.Remaining - nudQuantity.Value >= 0 & nudQuantity.Value > 0m) == true)
     {
         btnSave.Enabled = true;
     }
     else
     {
         btnSave.Enabled = false;
     }
 }
Exemplo n.º 4
0
        private void dgvBagLocations_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 3)
            {
                VW_InventoryBagLocation bagLocationToRemove = (VW_InventoryBagLocation)dgvBagLocations.Rows[e.RowIndex].DataBoundItem;
                dgvBagLocations.DataSource = null;
                if (!Information.IsNothing(bagLocationToRemove.BagInventoryId))
                {
                    My.MyProject.Forms.MessageBoxCeresOK.ShowDialog("Action not allowed", @"Can not delete a bag location that was already saved in an inventory because it would erase bag transaction logs.
If there's no bags at this location, modify bag invenotry quantity, selecting the option 'AJUST' and setting bag quantity to 0.", this);
                }
                else
                {
                    BagLocationList.Remove(bagLocationToRemove);
                }

                dgvBagLocations.DataSource = BagLocationList;
                calculateTotalBags();
            }
        }
Exemplo n.º 5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (Conversions.ToBoolean(GoodToGo()))
            {
                var bl = new VW_InventoryBagLocation();
                if (isNewLocation)
                {
                    bl.BagQuantity = default;
                }

                bl.LocationTag         = Strings.Trim(tbLocation.Text);
                bl.StorageTypeId       = Conversions.ToInteger(cboStorageType.SelectedValue);
                bl.StorageTypeName     = cboStorageType.Text;
                bl.StorageId           = (int?)cboStorage.SelectedValue;
                bl.BagQuantity         = (int)Math.Round(nudBagQty.Value);
                bl.LocationStorageName = cboStorage.Text;
                if (!My.MyProject.Forms.FrmAddEditInventory.BagLocationList.Contains(bl))
                {
                    My.MyProject.Forms.FrmAddEditInventory.BagLocationList.Add(bl);
                }

                Close();
            }
        }