Ejemplo n.º 1
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                Sico.Entidades.Usuario _usuario = CargarEntidad();

                if (UsuarioSeleccionado.Funcion == 2)
                {
                    bool Exito = UsuarioNeg.EditarUsuario(_usuario);
                    if (Exito == true)
                    {
                        LimpiarCampos();
                    }
                }
                else
                {
                    bool Exito = UsuarioNeg.GurdarUsuario(_usuario);
                    if (Exito == true)
                    {
                        LimpiarCampos();
                    }
                    else
                    {
                    }
                }
            }
            catch { }
        }
Ejemplo n.º 2
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         Entidades.Usuario _usuario = CargarEntidad();
         if (txtDni.Enabled == false)
         {
             bool Exito = UsuarioNeg.EditarUsuario(_usuario);
             if (Exito == true)
             {
                 ProgressBar();
                 const string message2 = "La edición del usuario se registro exitosamente.";
                 const string caption2 = "Éxito";
                 var          result2  = MessageBox.Show(message2, caption2,
                                                         MessageBoxButtons.OK,
                                                         MessageBoxIcon.Asterisk);
                 LimpiarCampos();
             }
         }
         else
         {
             bool Exito = UsuarioNeg.GurdarUsuario(_usuario);
             if (Exito == true)
             {
                 ProgressBar();
                 const string message2 = "Se registro el usuario exitosamente.";
                 const string caption2 = "Éxito";
                 var          result2  = MessageBox.Show(message2, caption2,
                                                         MessageBoxButtons.OK,
                                                         MessageBoxIcon.Asterisk);
                 LimpiarCampos();
             }
             else
             {
             }
         }
     }
     catch { }
 }