public void CargarOperador() { try { //var objUsers = new WSUsers.SwiftExpressWSUsers(); var objUsers = new WSRoute.SwiftExpressWSRoute(); var pResult = ""; //var ds = objUsers.GetUsers(Session["connectionString"].ToString(), ref pResult); var ds = objUsers.GetRoutesByUser(Session["connectionString"].ToString(), Session["LOGIN"].ToString(), ref pResult); if (pResult == "") { Session["OperadorGPS"] = ds; if (ds.Tables[0].Rows.Count > 0) { UiListaDeUsuarios.DataSource = ds; UiListaDeUsuarios.DataBind(); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } objUsers.Dispose(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!ValidarConexionYUsuarioLogueado(sender)) { return; } if (Session["connectionString"] == null || Session["USER"] == null) { ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true); UiVistaDePedidosMinimos.JSProperties.Add("cpLocation", "Enable"); return; } if (Session["UiListaDeUsuarios"] != null) { UiListaDeUsuarios.DataSource = Session["UiListaDeUsuarios"]; UiListaDeUsuarios.DataBind(); } if (Session["UiVistaDePedidosMinimos"] != null) { UiVistaDePedidosMinimos.DataSource = Session["UiVistaDePedidosMinimos"]; UiVistaDePedidosMinimos.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!ValidarConexionYUsuarioLogueado(sender)) { return; } if (Session["connectionString"] == null || Session["USER"] == null) { ScriptManager.RegisterStartupScript(this, GetType(), "Logoff", "LogOff();", true); //Response.Redirect("Login.aspx"); } if (!Page.IsPostBack) { UiListaDeUsuarios.GridView.Width = 350; CargarOperador(); UiFechaInicio.Value = DateTime.Today; UiFechaFinal.Value = DateTime.Today.AddDays(1); Session["RouteGPS"] = null; } if (Session["OperadorGPS"] != null) { UiListaDeUsuarios.DataSource = Session["OperadorGPS"]; UiListaDeUsuarios.DataBind(); } else { CargarOperador(); } if (Session["RouteGPS"] != null) { UiListadoDeClientes.DataSource = Session["RouteGPS"]; UiListadoDeClientes.DataBind(); } }