private bool ValidateForm()
        {
            if (!Regex.Match(ProductCodeTextBox.Text, @"^\d{5}$").Success)
            {
                MessageBox.Show("Invalid product code! It must contain 5 digits");
                ProductCodeTextBox.Focus();
                return(false);
            }

            if (GoodsInMarketComboBox.SelectedItem == null)
            {
                MessageBox.Show("Please select manufacture date");
                return(false);
            }

            var tempProduction = (GoodsInMarketOwnDTO)GoodsInMarketComboBox.SelectedItem;

            if (!Regex.Match(AmountTextBox.Text, @"^[0-9]*(?:\,[0-9]*)?$").Success || Convert.ToDouble(AmountTextBox.Text) > tempProduction.DoubleAmount)
            {
                MessageBox.Show("Invalid amount! Check the data you've entered! Or you're trying to write off more than it is in stock!");
                AmountTextBox.Focus();
                return(false);
            }

            if (ReasonComboBox.SelectedItem == null)
            {
                MessageBox.Show("Please select reason");
                return(false);
            }

            return(true);
        }
        private bool ValidateForm()
        {
            if (!Regex.Match(ProductCodeTextBox.Text, @"^\d{5}$").Success)
            {
                MessageBox.Show("Invalid product code! It must contain 5 digits");
                ProductCodeTextBox.Focus();
                return(false);
            }

            if (ShipmentDateComboBox.SelectedItem == null)
            {
                MessageBox.Show("Please select Shipment date!");
                return(false);
            }

            var tempDeliveryShipment = (DeliveryShipmentDTO)ShipmentDateComboBox.SelectedItem;

            if (!Regex.Match(AmountTextBox.Text, @"^[0-9]*(?:\,[0-9]*)?$").Success || Convert.ToDouble(AmountTextBox.Text) > tempDeliveryShipment.Amount)
            {
                MessageBox.Show("Invalid amount! Check the data you've entered! Or you're trying to write off more than it is in stock!");
                AmountTextBox.Focus();
                return(false);
            }

            if (ReasonComboBox.SelectedItem == null)
            {
                MessageBox.Show("Please select reason!");
                return(false);
            }

            return(true);
        }
        private bool ValidateForm()
        {
            if (!Regex.Match(AmountTextBox.Text, @"^[0-9]*(?:\,[0-9]*)?$").Success || AmountTextBox.Text == "")
            {
                MessageBox.Show("Invalid amount! Check the data you've entered!");
                AmountTextBox.Focus();
                return(false);
            }

            if (!Regex.Match(ProductCodeTextBox.Text, @"^\d{5}$").Success)
            {
                MessageBox.Show("Invalid product code! It must contain 5 digits");
                ProductCodeTextBox.Focus();
                return(false);
            }

            if (!Regex.Match(IncomePriceTextBox.Text, @"^[0-9]*(?:\,[0-9]*)?$").Success ||
                IncomePriceTextBox.Text == "")
            {
                MessageBox.Show("Invalid price! Check the data you've entered!");
                IncomePriceTextBox.Focus();
                return(false);
            }

            return(true);
        }
Exemplo n.º 4
0
 public void ClearTextbox()
 {
     SupplierComboBox.SelectedIndex = -1;
     SupplierComboBox.Items.Clear();
     textBox1.Clear();
     textBox2.Clear();
     textBox3.Clear();
     textBox4.Clear();
     textBox5.Clear();
     ProductNameTextBox.Clear();
     ProductDesTextBox.Clear();
     ProductCodeTextBox.Clear();
     ShipingQtyTextBox.Clear();
     totalItemTextBox.Clear();
     totalQuantityTextBox.Clear();
     prNmSrchBx.Clear();
     itmDscrptnSrchBx.Clear();
     pNCheckBox.Checked = false;
     pDCheckBox.Checked = false;
     itmCdSrchBx.Clear();
     iOSrchBx.Clear();
     pCCheckBox.Checked = false;
     iOCheckBox.Checked = false;
     listView1.Items.Clear();
     dataGridView1.Rows.Clear();
     dataGridView1.Refresh();
     totalQuantity = 0;
     totalItem     = 0;
 }
Exemplo n.º 5
0
 private void ClearselectedProduct()
 {
     impOd = null;
     ProductCodeTextBox.Clear();
     ShipingQtyTextBox.Clear();
     ProductDesTextBox.Clear();
     ProductNameTextBox.Clear();
 }
Exemplo n.º 6
0
 private void ProductDesTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         ProductCodeTextBox.Focus();
         e.Handled = true;
     }
 }
Exemplo n.º 7
0
 public void Cleardata()
 {
     FilenameLabel.Text = "FileNotSelected";
     PriceTextBox.Clear();
     QuantityTextBox.Clear();
     ProductCodeTextBox.Clear();
     ProductNameTextBox.Clear();
 }
Exemplo n.º 8
0
 // FOR: ResetRecords For All Buttons Applay
 private void ResetRecords()
 {
     ProductCodeTextBox.Clear();
     ProductNameTextBox.Clear();
     StatusComboBox.SelectedIndex = -1;
     AddButton.Text = "Add";
     ProductCodeTextBox.Focus();
 }
Exemplo n.º 9
0
 private void ClearControls()
 {
     ProductCodeTextBox.Text    = "";
     DescriptionTextBox.Text    = "";
     UnitPriceTextBox.Text      = "";
     OnHandQuantityTextBox.Text = "";
     ModifyButton.Enabled       = false;
     DeleteButton.Enabled       = false;
     ProductCodeTextBox.Select();
 }
Exemplo n.º 10
0
 private void ClearselectedProduct()
 {
     ShipmentProductId    = null;
     ImportOrderProductId = null;
     Sl         = null;
     checkvalue = null;
     backlogQty = null;
     ProductCodeTextBox.Clear();
     ShipingQtyTextBox.Clear();
     ProductDesTextBox.Clear();
     ProductNameTextBox.Clear();
 }
Exemplo n.º 11
0
        private bool ValidateForm()
        {
            if (!Regex.Match(ProductCodeTextBox.Text, @"^\d{5}$").Success)
            {
                MessageBox.Show("Invalid product code! It must contain 5 digits");
                ProductCodeTextBox.Focus();
                return(false);
            }

            if (MarketComboBox.SelectedItem == null)
            {
                MessageBox.Show("Please select market!");
                return(false);
            }

            return(true);
        }