Exemple #1
0
 private void limpiar()
 {
     TxtPass1.Clear();
     TxtPass2.Clear();
     TxtUsu.Clear();
     CboTipo.SelectedIndex = 1;
 }
 private void TxtUsername_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TxtPass1.Focus();
     }
 }
Exemple #3
0
 private void limpiar()
 {
     TxtNom.Clear();
     TxtUsu.Clear();
     TxtPass1.Clear();
     TxtPass2.Clear();
     LblId.Text = "0";
 }
Exemple #4
0
 private void TxtPass2_Validating(object sender, CancelEventArgs e)
 {
     if (TxtPass1.Text != TxtPass2.Text)
     {
         errorP1.SetError(TxtPass1, "Las contraseñas no coinciden.");
         TxtPass1.Focus();
     }
     else
     {
         errorP1.SetError(TxtPass1, "");
     }
 }
Exemple #5
0
        private void BtnAgegar_Click(object sender, EventArgs e)
        {
            if (TxtPass1.Text == TxtPass2.Text)
            {
                ingreso();
            }

            else
            {
                MessageBox.Show("Las contraseñas no coinciden");
                TxtPass2.Clear();
                TxtPass1.Clear();
            }
        }
        private void GetUsuarios_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = f.GetTipoUsurios(ConexionDB.getInstancia().Conexion(null, null)).Tables[0];

                LueTipoUsuario.Properties.DataSource    = dt;
                LueTipoUsuario.Properties.DisplayMember = "Nombre";
                LueTipoUsuario.Properties.ValueMember   = "Codigo";

                DevExpress.XtraEditors.Controls.LookUpColumnInfo col;
                col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Nombre", "Nombre", 100);
                //col.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
                LueTipoUsuario.Properties.Columns.Add(col);
                LueTipoUsuario.ItemIndex = -1;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2);
                return;
            }

            TxtUsuario.Focus();
            if (Modo == "E" && Id > 0)
            {
                CargarDatos(Id);
                LueTipoUsuario.Enabled = false;
                TxtUsuario.Enabled     = false;

                if (LueTipoUsuario.EditValue.ToString() != "01")
                {
                    TxtPass1.Focus();
                    panel3.Visible = false;

                    panel1.Location        = new Point(16, 40);
                    acceptCancel1.Location = new Point(216, 166);
                    this.Size = new Size(604, 216);
                }
            }
        }
Exemple #7
0
        public bool ValidarUsu()
        {
            bool retorno = true;


            if (string.IsNullOrEmpty((TxtUsuario.Text)))
            {
                errorP1.SetError(TxtUsuario, "Debe ingresar el usuario.");
                TxtUsuario.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtUsuario, "");
            }

            if (string.IsNullOrEmpty((TxtPass1.Text)))
            {
                errorP1.SetError(TxtPass1, "Debe ingresar la contraseña.");
                TxtPass1.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPass1, "");
            }

            if (string.IsNullOrEmpty((TxtPass2.Text)))
            {
                errorP1.SetError(TxtPass2, "Debe confirmar la contraseña.");
                TxtPass2.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(TxtPass2, "");

                if (TxtPass1.Text != TxtPass2.Text)
                {
                    errorP1.SetError(TxtPass2, "Las contraseñas no coinciden.");
                    TxtPass2.Focus();
                    retorno = false;
                }
                else
                {
                    errorP1.SetError(TxtPass2, "");
                }
            }

            if (LueTipoUsuario.ItemIndex < 0)
            {
                errorP1.SetError(LueTipoUsuario, "Debe seleccionar un tipo de ususario.");
                LueTipoUsuario.Focus();
                retorno = false;
            }
            else
            {
                errorP1.SetError(LueTipoUsuario, "");
            }

            return(retorno);
        }