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); }
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; }
private void ClearselectedProduct() { impOd = null; ProductCodeTextBox.Clear(); ShipingQtyTextBox.Clear(); ProductDesTextBox.Clear(); ProductNameTextBox.Clear(); }
private void ProductDesTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ProductCodeTextBox.Focus(); e.Handled = true; } }
public void Cleardata() { FilenameLabel.Text = "FileNotSelected"; PriceTextBox.Clear(); QuantityTextBox.Clear(); ProductCodeTextBox.Clear(); ProductNameTextBox.Clear(); }
// FOR: ResetRecords For All Buttons Applay private void ResetRecords() { ProductCodeTextBox.Clear(); ProductNameTextBox.Clear(); StatusComboBox.SelectedIndex = -1; AddButton.Text = "Add"; ProductCodeTextBox.Focus(); }
private void ClearControls() { ProductCodeTextBox.Text = ""; DescriptionTextBox.Text = ""; UnitPriceTextBox.Text = ""; OnHandQuantityTextBox.Text = ""; ModifyButton.Enabled = false; DeleteButton.Enabled = false; ProductCodeTextBox.Select(); }
private void ClearselectedProduct() { ShipmentProductId = null; ImportOrderProductId = null; Sl = null; checkvalue = null; backlogQty = null; ProductCodeTextBox.Clear(); ShipingQtyTextBox.Clear(); ProductDesTextBox.Clear(); ProductNameTextBox.Clear(); }
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); }