Example #1
0
 private void BulkEntryChanged()
 {
     //INSTANT C# TODO TASK: The following 'On Error GoTo' statement cannot be converted by Instant C#:
     //On Error GoTo Err
     try
     {
         if (((int.Parse(QtyTextEdit.Text) > 0 && int.Parse(QtyPerPltTextEdit.Text) > 0) || int.Parse(QtyTextEdit.Text) == 0) && LotCodeValidator.ValidateByItemID(Convert.ToInt32(itemLookUpEdit.EditValue), LotTextEdit.Text, true))
         {
             AddLPN_SimpleButton.Enabled  = true;
             AddToLPNSimpleButton.Enabled = int.Parse(QtyTextEdit.Text) <= int.Parse(QtyPerPltTextEdit.Text) && Convert.ToInt32(itemLookUpEdit.EditValue) == m_lastItem;
         }
         else
         {
             //Err:
             AddLPN_SimpleButton.Enabled  = false;
             AddToLPNSimpleButton.Enabled = false;
         }
     }
     catch
     {
         AddLPN_SimpleButton.Enabled  = false;
         AddToLPNSimpleButton.Enabled = false;
     }
 }
Example #2
0
        public bool ValidateRecord()
        {
            if (itemLookUpEdit.EditValue == null || (itemLookUpEdit.EditValue == null ? null : Convert.ToString(itemLookUpEdit.EditValue)) == itemLookUpEdit.Properties.NullText)
            {
                MessageBox.Show("You must select a Item Code.");
                itemLookUpEdit.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(newQtyTextEdit.Text) && string.IsNullOrEmpty(newLotTextEdit.Text))
            {
                MessageBox.Show("You must enter a new quantity or lot.");
                newQtyTextEdit.Focus();
                return(false);
            }
            else if (!string.IsNullOrEmpty(newQtyTextEdit.Text) && !string.IsNullOrEmpty(newLotTextEdit.Text))
            {
                if (saveSimpleButton.Tag != null && newQtyTextEdit.Text == "0")
                {
                    newQtyTextEdit.Text = null;
                }
                else
                {
                    MessageBox.Show("You cant update quantity and lot at once.");
                    newQtyTextEdit.Focus();
                    return(false);
                }
            }

            if (originalLotLookUpEdit.EditValue == null && lpnLookUpEdit.EditValue != null)
            {
                MessageBox.Show("You must select a Lot.");
                originalLotLookUpEdit.Focus();
                return(false);
            }

            if (!string.IsNullOrEmpty(newLotTextEdit.Text) && LotCodeValidator.ValidateByItemID(Convert.ToInt32(itemLookUpEdit.GetColumnValue("ItemID")), newLotTextEdit.Text, true) == false)
            {
                MessageBox.Show("Lot code invalid.");
                newLotTextEdit.Focus();
                return(false);
            }

            if (string.IsNullOrEmpty(Convert.ToString(reasonMemoExEdit.EditValue)) == true)
            {
                if (MessageBox.Show(string.Format("The reason field is empty. {0} Do you want to save the record.", Environment.NewLine), "Save Adjustment", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No)
                {
                    return(false);
                }
                else
                {
                }
            }

            if (locationLookUpEdit.EditValue == null || (locationLookUpEdit.EditValue == null ? null : Convert.ToString(locationLookUpEdit.EditValue)) == locationLookUpEdit.Properties.NullText)
            {
                MessageBox.Show("You must select a Location.");
                locationLookUpEdit.Focus();
                return(false);
            }

            if (saveSimpleButton.Tag == null)
            {
                if (m_AllowAdd == true)
                {
                    saveSimpleButton.Tag = InventoryAdjustmentBLL.GetNewInventoryAdjustmentID();
                }
                else
                {
                    return(false);
                }
            }

            return(true);
        }