示例#1
0
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            DTOUsuario adm = new DTOUsuario();

            adm.Cedula  = txtCedula.Text;
            adm.Usuario = txtUsuario.Text;
            adm.Clave   = txtContrasena.Text;

            int valorA;

            if (RadioAdministrador.Checked == true)
            {
                valorA = 1;
            }
            else
            {
                valorA = 0;
            }
            adm.Administrador = valorA;
            int valorP;

            if (Radiooperativo.Checked == true)
            {
                valorP = 1;
            }
            else
            {
                valorP = 0;
            }
            adm.Operativo = valorP;



            CADUsuario datocamp = new CADUsuario();

            datocamp.ingresarUsuario(adm);
            cargarUsuarios();
            txtCedula.Text             = "";
            txtContrasena.Text         = "";
            txtUsuario.Text            = "";
            RadioAdministrador.Checked = false;
            Radiooperativo.Checked     = false;

            gvusuarios.DataBind();
        }
示例#2
0
        private void btnRegistrar_Click(object sender, RoutedEventArgs e)
        {
            DTOUsuario adm = new DTOUsuario();

            adm.Cedula  = txtCedula.Text;
            adm.Usuario = txtUsuario.Text;
            adm.Clave   = txtContrasena.Text;

            int valorA;

            if (RadioAdministrador.IsChecked == true)
            {
                valorA = 1;
            }
            else
            {
                valorA = 0;
            }
            adm.Administrador = valorA;
            int valorP;

            if (Radiooperativo.IsChecked == true)
            {
                valorP = 1;
            }
            else
            {
                valorP = 0;
            }
            adm.Operativo = valorP;



            CADUsuario datocamp = new CADUsuario();

            datocamp.ingresarUsuario(adm);


            Tile_Click_6(sender, e);
        }