protected void Page_Load(object sender, EventArgs e) { if (Servicio == null) { if (Session["Servicio"] != null) { Servicio = (TeleBancaWS.TeleBancaWS)Session["Servicio"]; } } string Report = Request.QueryString["Report"]; int type = Convert.ToInt16(Report); string ReportPath; DataSet DTS = Servicio.ReporteTarjetas(type); if (type == 0) { DTS.DataSetName = "MyDataSet"; DTS.Tables[0].TableName = "Tarjetas"; ReportPath = Server.MapPath("~/Reports/ReporteTarjetas.rpt"); CrystalReportSource1.ReportDocument.Load(ReportPath); CrystalReportSource1.ReportDocument.SetDataSource(DTS); Reporte_Tarjetas.ReportSource = CrystalReportSource1; Reporte_Tarjetas.RefreshReport(); } else { DTS.DataSetName = "MyDataSet"; DTS.Tables[0].TableName = "Tarjetas_Asociados"; ReportPath = Server.MapPath("~/Reports/ReporteTarjetasAsociadas.rpt"); CrystalReportSource1.ReportDocument.Load(ReportPath); CrystalReportSource1.ReportDocument.SetDataSource(DTS); Reporte_Tarjetas.ReportSource = CrystalReportSource1; Reporte_Tarjetas.RefreshReport(); } }
protected void Page_Load(object sender, EventArgs e) { if (((MultiView)WebUserControl_ServicioPago1.FindControl("MVWPago")).ActiveViewIndex == 1) { MultiView1.ActiveViewIndex = 2; ImageButton8.Visible = true; ImageButton7.Visible = false; } Label1.Text = Convert.ToString(DateTime.Today.Year); InitializeComponent(); try { if (!this.IsPostBack) { MultiView1.ActiveViewIndex = 0; } if (Servicio == null) { if (Session["Servicio"] != null) { Servicio = (TeleBancaWS.TeleBancaWS)Session["Servicio"]; } } LblShowNombre.Text = Servicio.getUsuariActivo()[2]; } catch (Exception ex) { Errores.Alert(this, ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { //string banco = Servicio.CLlamadas(); Label7.Text = "Bienvenido"; try { if (Session["Clave"].ToString() == "0") { Label5.Visible = true; Label6.Visible = true; Label5.Text = "!!! Su contraseña vence hoy, le sugerimos cambiarla, para ello haga clic "; LinkButton1.Visible = true; } if (Session["Clave"] != null && Session["Clave"].ToString() != "0") { Label5.Visible = true; Label6.Visible = true; Label5.Text = "!!! Su contraseña caducará en " + Session["Clave"] + " días, le sugerimos cambiarla, para ello haga clic "; LinkButton1.Visible = true; } if (Convert.ToInt32(Session["Clave"]) > 7) { Label5.Visible = false; Label6.Visible = false; Label5.Text = ""; LinkButton1.Visible = false; } if (Convert.ToInt32(Session["Clave"]) < 0) { Label5.Visible = true; Label6.Visible = true; Label5.Text = "!!! Su contraseña venció hace" + Convert.ToInt32(Session["Clave"]) + " días, le sugerimos cambiarla, para ello haga clic "; LinkButton1.Visible = true; } if (Servicio == null) { if (Session["Servicio"] != null) { Servicio = (TeleBancaWS.TeleBancaWS)Session["Servicio"]; } } } catch { Errores.Alert(this, "Su sesion ha expirado. Vuelva a autenticarse"); return; } }
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { TeleBancaWS.TeleBancaWS TempServ = new TeleBancaWS.TeleBancaWS(); TempServ.CookieContainer = new System.Net.CookieContainer(); try { e.Authenticated = TempServ.Autenticar(Login1.UserName, CriptoTeleBanca.CriptografiaTeleBanca.EncriptarPasswordSHA1(Login1.Password)); } catch (Exception ee) { Session["mensaje"] = "MismoUsuario"; Response.Redirect("Notificaciones.aspx"); } if (e.Authenticated) { Session["Servicio"] = TempServ; DateTime Fecha = TempServ.Fecha_Expira(Login1.UserName); TimeSpan calculo = Fecha.Subtract(DateTime.Now.Date); int d = calculo.Days; if (d != 0 && d <= 7) { Session["Clave"] = Convert.ToString(d); Response.Redirect("Main.aspx"); } if (!calculo.ToString().StartsWith("-")) { Session["Clave"] = Convert.ToString(d); Response.Redirect("Main.aspx"); } if (calculo.ToString().StartsWith("-")) { Session["Clave"] = "Vencida"; TempServ.DesactivarUser(Login1.UserName); Response.Redirect("Notificaciones.aspx"); } if (d > 7) { Session["Clave"] = Convert.ToString(d); } } else { int temp = Convert.ToInt32(Session["intentos"]); aux = temp + 1; Session["intentos"] = aux.ToString(); if (aux >= 3) { string user_dominio = User.Identity.Name; string ip_remoto = Page.Request.ServerVariables["REMOTE_ADDR"]; string nombre_pc = Page.Request.ServerVariables["REMOTE_HOST"]; string descripción = "Bloqueado por " + user_dominio + " desde la PC: " + nombre_pc + " con IP: " + ip_remoto; TempServ.DesactivarUser(Login1.UserName); //TempServ.Quien_Bloquea_Usuario(Login1.UserName, descripción); Session["bloqueo"] = "bloqueado"; Response.Redirect("Notificaciones.aspx"); Login1.Enabled = false; } else { Session["bloqueo"] = "libre"; } } }