protected void btnGuardar_Click(object sender, EventArgs e) { //cUsuarios = new cUsuarios(); if (ddlEmpleado.SelectedValue != "0") { if (txtUsuario.Text != "") { mUsuario.usuario = txtUsuario.Text; mUsuario.id_empleado = int.Parse(ddlEmpleado.SelectedValue); mUsuario.id_tipo_usuario = int.Parse(ddlTipoUsuario.SelectedValue); mUsuario.correo = txtCorreo.Text; // objUsuarios = new cUsuarios(); if (cUsuarios.IngresoNuevoUsuario(mUsuario, txtcontra.Text)) { limpiarCampos(); ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Usuario ingresado exitosamente!', '', 'success');", true); } else { ScriptManager.RegisterStartupScript(this, typeof(string), "Mensaje", "swal('Ya existe usuario', 'Por favor intente con otro nombre de usuario', 'warning');", true); } } } }