Example #1
0
 private void ResetRecords()
 {
     // dateTimePicker1.Value = DateTime.Now;
     ProductIdtxt.Clear();
     Productnametxt.Clear();
     Quantitytxt.Clear();
     comboBoxproductstatus.SelectedIndex = -1;
     Addbtn.Text = "Add";
     dateTimePicker1.Focus();
 }
Example #2
0
 private void Quantitytxt_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (Quantitytxt.Text.Length > 0)
         {
             comboBoxproductstatus.Focus();
         }
         else
         {
             Quantitytxt.Focus();
         }
     }
 }
Example #3
0
 private void Productnametxt_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (Productnametxt.Text.Length > 0)
         {
             Quantitytxt.Focus();
         }
         else
         {
             Productnametxt.Focus();
         }
     }
 }
Example #4
0
 private bool IsValid()
 {
     {
         if (ProductIdtxt.Text.Trim() == string.Empty)
         {
             MessageBox.Show("Inter Product ID", "Form validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             ProductIdtxt.Focus();
             return(false);
         }
         if (Productnametxt.Text.Trim() == string.Empty)
         {
             MessageBox.Show("Inter Product", "Form validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             Productnametxt.Focus();
             return(false);
         }
         if (Quantitytxt.Text.Trim() == string.Empty)
         {
             MessageBox.Show("Inter Product Qty", "Form validation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             Quantitytxt.Focus();
             return(false);
         }
         return(true);
     }
 }