public static RetornoAjax Prueba() { var ajax = new NavigatorAjax(); var ret = new RetornoAjax(); ret.ret = "OK"; return(ret); }
protected void Login(object sender, EventArgs e) { var usuario = txtUser.Value.Trim().ToLower(); var password = txtPass.Value.Trim(); if (string.IsNullOrEmpty(usuario)) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "alertaErrorLogin('Debe ingresar un usuario');", true); txtUser.Focus(); return; } if (string.IsNullOrEmpty(password)) { ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "alertaErrorLogin('Debe ingresar una contraseña.');", true); txtPass.Focus(); return; } Usuarios users = new Usuarios(); users.User = usuario; users.Pass = password; NavigatorAjax ajax = new NavigatorAjax(); var data = ajax.Login(users); if (data.ret == "OK") { var loggedUser = (Usuario)data.values[0]; Session.Add("LoggedUser", loggedUser); Response.Redirect("Home.aspx"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Popup", "alertaErrorLogin('" + data.msg + "');", true); txtPass.Focus(); return; } Response.Redirect("Home.aspx"); }
public static RetornoAjax CrearUsuario(Usuarios nuevoRegistro) { var ajax = new NavigatorAjax(); return(ajax.RegistroUsuario(nuevoRegistro)); }
public static RetornoAjax getCodigo(string codigo) { var ajax = new NavigatorAjax(); return(ajax.getCodigo(codigo)); }
public static RetornoAjax llenarCombo() { var ajax = new NavigatorAjax(); return(ajax.LlenarCombo()); }