Example #1
0
 private void LimCombo_Leave(object sender, EventArgs e)
 {
     try
     {
         Common.FormatCombo(LimCombo);
         if (LimCombo.Text.Length <= 0)
         {
             EP.SetError(LimCombo, "Type the File Name First...");
             LimCombo.Focus();
             return;
         }
         else if (LimCombo.Text.Length <= 5)
         {
             EP.SetError(LimCombo, "The name should be More than 5 Letters...");
             LimCombo.Focus();
         }
         else if (((LimCombo.Text.Substring(0, 4)) == "Lim_") || ((LimCombo.Text.Substring(0, 4)) == "LIM_") || ((LimCombo.Text.Substring(0, 4)) == "lim_"))
         {
             LimCombo.Text = "lim_" + (LimCombo.Text.Substring(4)).ToLower();
             EP.Clear();
         }
         else
         {
             LimCombo.Text = "lim_" + LimCombo.Text.ToLower();
             EP.Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" LimCombo_Leave @ Error Code:-7013 " + ex.Message);
     }
 }
Example #2
0
 private void TextBox4_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (!(string.IsNullOrEmpty(TextBox4.Text)))
         {
             EP.Clear();
             char[] chars = TextBox4.Text.ToCharArray();
             for (int i = 0; i < TextBox4.Text.Length; i++)
             {
                 int code;
                 code = Convert.ToInt16(chars[i]);
                 if (!((!(code > 57 || code < 48)) || (code == 46)))
                 {
                     TextBox4.Text           = TextBox4.Text.Remove(i, 1);
                     TextBox4.SelectionStart = TextBox4.Text.Length;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error Code:- 14004", ex.Message);
         Global.Create_OnLog(ex.Message);
     }
 }
Example #3
0
 private void TextBox1_TextChanged(object sender, EventArgs e)
 {
     if (TextBox1.Text == "")
     {
         EP.SetError(TextBox1, "Fill the Company name first");
         TextBox1.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #4
0
 private void TextBox2_Leave(object sender, EventArgs e)
 {
     if (TextBox2.Text == "")
     {
         EP.SetError(TextBox2, "Fill the Department first");
         TextBox2.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #5
0
 private void TextBox9_Leave(object sender, EventArgs e)
 {
     if (TextBox9.Text == "")
     {
         EP.SetError(TextBox9, "Fill the first start time first");
         TextBox9.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #6
0
 private void TextBox8_Leave(object sender, EventArgs e)
 {
     if (TextBox8.Text == "")
     {
         EP.SetError(TextBox8, "Fill the Test Cell no. first");
         TextBox8.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #7
0
 private void TextBox6_Leave(object sender, EventArgs e)
 {
     if (TextBox6.Text == "")
     {
         EP.SetError(TextBox6, "Fill the Blank Text first");
         TextBox6.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #8
0
 private void TextBox4_Leave(object sender, EventArgs e)
 {
     if (TextBox4.Text == "")
     {
         EP.SetError(TextBox4, "Fill the Max RPM first");
         TextBox4.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #9
0
 private void TextBox3_Leave(object sender, EventArgs e)
 {
     if (TextBox3.Text == "")
     {
         EP.SetError(TextBox3, "Fill the Max Torque first");
         TextBox3.Focus();
     }
     else
     {
         EP.Clear();
     }
 }
Example #10
0
        private bool LosDatosIngresadosSonCorrectos()
        {
            EP.Clear();

            if (Controles.IsNullOEmptyElControl(txtNombre))
            {
                EP.SetError(txtNombre, "Este valor no puede quedar vacio");
                txtNombre.Focus();
                return(false);
            }

            return(true);
        }
        private void LoginUsuario()
        {
            EP.Clear();

            if (string.IsNullOrEmpty(txtUsuario.Text) || txtUsuario.Text.Trim().Length == 0)
            {
                EP.SetError(txtUsuario, "Este campo no puede quedar vacio");
                txtUsuario.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtContraseña.Text) || txtContraseña.Text.Trim().Length == 0)
            {
                EP.SetError(txtContraseña, "Este campo no puede quedar vacio");
                txtContraseña.Focus();
                return;
            }

            this.Cursor = Cursors.WaitCursor;

            Program.oLoginEN.contraseña = CifrarCadenas.EncriptarCadena(txtContraseña.Text);
            Program.oLoginEN.Login      = txtUsuario.Text.Trim();

            LoginLN oLoginLN = new LoginLN();

            if (oLoginLN.IniciarLaSesionDelUsuario(Program.oLoginEN, Program.oDatosDeConexion))
            {
                if (oLoginLN.TraerDatos().Rows.Count > 0)
                {
                    Program.Iniciar = true;
                    this.Cursor     = Cursors.Default;
                    CargarInformacionDeLaConfiguracion();
                    this.Close();
                }
                else
                {
                    this.Cursor     = Cursors.Default;
                    Program.Iniciar = false;
                    MessageBox.Show("Usuario o contraseña inválidos: " + oLoginLN.Error, "Inicio de sesión", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    txtUsuario.Focus();
                }
            }
            else
            {
                this.Cursor     = Cursors.Default;
                Program.Iniciar = false;
                MessageBox.Show("Usuario o contraseña inválidos: " + oLoginLN.Error, "Inicio de sesión", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUsuario.Focus();
            }
        }
Example #12
0
 private void Baceptar_Click(object sender, EventArgs e)
 {
     if (TBMatricula.Text == "")
     {
         EP.SetError(TBMatricula, "No ingreso matricula");
     }
     if (TBNombre.Text == "")
     {
         EP.SetError(TBNombre, "No ingreso nombre");
     }
     if (TBCarrera.Text == "")
     {
         EP.SetError(TBCarrera, "No ingreso carrera");
     }
     if (TBSemestre.Text == "")
     {
         EP.SetError(TBSemestre, "No ingreso semestre");
     }
     if (TBTelefono.Text == "")
     {
         EP.SetError(TBTelefono, "No ingreso telefono");
     }
     try
     {
         Alumno alumno = new Alumno();
         alumno.Matricula = Convert.ToInt32(TBMatricula.Text);
         alumno.Nombre    = TBNombre.Text;
         alumno.Semestre  = Convert.ToInt32(TBSemestre.Text);
         alumno.Carrera   = TBCarrera.Text;
         alumno.Telefono  = Convert.ToInt32(TBTelefono.Text);
         alumnos.Add(alumno);
         throw new Specialexception("Su alumno se creo exitosamente");
     }
     catch (FormatException r)
     {
         MessageBox.Show("Error en registracion " + r.Message);
     }
     catch (Specialexception espr)
     {
         MessageBox.Show(espr.Message);
     }
     finally
     {
         EP.Clear();
     }
 }
Example #13
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (ComboBox7.Text == "")
            {
                EP.SetError(ComboBox7, "Select the Comport first");
                GroupBox3.BringToFront();
                GroupBox2.SendToBack();
                Button3.Enabled = false;
                return;
            }
            if (ComboBox18.Text == "")
            {
                EP.SetError(ComboBox18, "Select the Comport first");
                GroupBox3.BringToFront();
                GroupBox2.SendToBack();
                Button3.Enabled = false;
                return;
            }
            if (ComboBox19.Text == "")
            {
                EP.SetError(ComboBox19, "Select the Comport first");
                GroupBox3.BringToFront();
                GroupBox2.SendToBack();
                Button3.Enabled = false;
                return;
            }
            if (ComboBox21.Text == "")
            {
                EP.SetError(ComboBox21, "Select the Comport first");
                GroupBox3.BringToFront();
                GroupBox2.SendToBack();
                Button3.Enabled = false;
                return;
            }

            Button3.Enabled = true;
            EP.Clear();
            Save_File();
        }
 private void LimpiarEP()
 {
     EP.Clear();
 }