protected void btnAutenticarUsuario_Click(object sender, EventArgs e) { Negocio.Otros Consulta = new Negocio.Otros(); Consulta.Proc = Negocio.Otros.Procedimientos.spt_SEL_ObtieneLogin; Consulta.Usuario = txtNombreUsuario.Text.Trim(); Consulta.Contraseña = txtContrasenia.Text.Trim(); Consulta.Perfil = cblPerfiles.SelectedValue.ToString().Trim(); Consulta.Busqueda(); if (Consulta.datos != null) { Negocio.Ent_Usuario _Ent_Usuario = new Negocio.Ent_Usuario(); _Ent_Usuario.Id_Usuario = Consulta.datos.Tables[0].Rows[0][0].ToString(); _Ent_Usuario.Usuario = Consulta.datos.Tables[0].Rows[0][1].ToString(); _Ent_Usuario.NombreUsuario = Consulta.datos.Tables[0].Rows[0][2].ToString(); _Ent_Usuario.Usuario_ClaveEntidad = Consulta.datos.Tables[0].Rows[0][3].ToString(); _Ent_Usuario.Usuario_Entidad = Consulta.datos.Tables[0].Rows[0][4].ToString(); _Ent_Usuario.Perfil = Consulta.datos.Tables[0].Rows[0][5].ToString(); _Ent_Usuario.Concurso = System.Configuration.ConfigurationSettings.AppSettings["Concurso"].ToString(); Session["Info_User"] = _Ent_Usuario; Response.Redirect("webDefault.aspx"); } else { txtContrasenia.Text = ""; txtNombreUsuario.Text = ""; LlenarPerfiles(); new WebNegocio.Utils().Mensaje(this.Page, "Usuario, contraseña o perfil invalidos."); return; } }
protected void Page_Load(object sender, EventArgs e) { wucFiltros1.Buscar += new EventHandler <Controles.FiltrosArg>(wucFiltros1_Buscar); _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; if (!IsPostBack) { } }
protected void Page_Load(object sender, EventArgs e) { _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; if (!IsPostBack) { CargarCombos(); } }
protected void Page_Load(object sender, EventArgs e) { wucFiltros1.Buscar += new EventHandler<Controles.FiltrosArg>(wucFiltros1_Buscar); _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; if (!IsPostBack) { } }
protected void btn_Exportar_Click(object sender, EventArgs e) { if (gvReporte.Rows.Count > 0) { Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.ms-excel"; Response.ContentEncoding = System.Text.Encoding.UTF8; Response.BinaryWrite(System.Text.Encoding.UTF8.GetPreamble()); using (StringWriter sw = new StringWriter()) { HtmlTextWriter hw = new HtmlTextWriter(sw); //To Export all pages gvReporte.AllowPaging = false; Negocio.Ent_Usuario _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; Buscar(_Ent_Usuario); gvReporte.HeaderRow.BackColor = Color.White; foreach (TableCell cell in gvReporte.HeaderRow.Cells) { cell.BackColor = gvReporte.HeaderStyle.BackColor; } foreach (GridViewRow row in gvReporte.Rows) { row.BackColor = Color.White; foreach (TableCell cell in row.Cells) { //if (row.RowIndex % 2 == 0) //{ // cell.BackColor = gvReporte.AlternatingRowStyle.BackColor; //} //else //{ // cell.BackColor = gvReporte.RowStyle.BackColor; //} cell.CssClass = "textmode"; } } gvReporte.RenderControl(hw); //style to format numbers to string string style = @"<style> .textmode { } </style>"; Response.Write(style); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; if (!IsPostBack) { Llenar_Entidades(); ddlEntidad.SelectedValue = _Ent_Usuario.Usuario_ClaveEntidad; if (_Ent_Usuario.Perfil == "A") { ddlEntidad.Enabled = false; } Buscar(_Ent_Usuario); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; ObtenEntidadTodos(); //if (_Ent_Usuario.ClaveEntidad == null) { // _Ent_Usuario.ClaveEntidad = "1"; //} cbo_Entidad.SelectedValue = _Ent_Usuario.ClaveEntidad; fillGV(); Get_Info(); if (_Ent_Usuario.Perfil == "O" || _Ent_Usuario.Perfil == "I") { cbo_Entidad.Enabled = true; } } }
protected void wucFiltros1_Buscar(object sender, WFront.Controles.FiltrosArg e) { Negocio.Ent_Usuario _Ent_Usuario = new Negocio.Ent_Usuario(); if (Validar_Usuario(_Ent_Usuario, _Ent_Usuario.ClaveEntidad) == true) { _Ent_Usuario.Funcion = e.Funcion; _Ent_Usuario.TipoEvaluacion = e.Tipo_Evaluacion; _Ent_Usuario.Servicio = e.Servicio; _Ent_Usuario.ClaveEntidad = e.ClaveEntidad.ToString(); _Ent_Usuario.TipoSostenimiento = e.Tipo_Sostenimiento; _Ent_Usuario.ClaveEstatusAsignacion = e.ClaveEstatusAsignacion; Buscar(_Ent_Usuario); Session["Info_User"] = _Ent_Usuario; } else { gvReporte.Visible = false; lblMensaje.Visible = true; } }
private void Buscar(Ent_Usuario _Ent_Usuario) { try { Negocio.Reportes rep = new Negocio.Reportes(); rep._Ent_Usuario = new ReportesArg { _Ent_Usuario = _Ent_Usuario }; rep.Proc = Negocio.Reportes.Procedimientos.spt_Asignacion_SEL_Cat_TipoNombramiento; rep.Busqueda(); if (rep.datos != null) { gvReporte.DataSource = rep.datos; gvReporte.DataBind(); gvReporte.Visible = true; } } catch { } }
protected void gvReporte_PageIndexChanging(object sender, GridViewPageEventArgs e) { gvReporte.PageIndex = e.NewPageIndex; Negocio.Ent_Usuario _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; Buscar(_Ent_Usuario); }
private bool Validar_Usuario(Ent_Usuario _Ent_Usuario, string Entidad_Validar) { switch (_Ent_Usuario.Perfil) { case "A": if (_Ent_Usuario.Usuario_Entidad != Entidad_Validar) { new WebNegocio.Utils().Mensaje(this.Page, "Su nivel de usuario no le permite hacer consultas en otras entidades."); return false; } break; } return true; }
private void Buscar(Ent_Usuario _Ent_Usuario) { if (Validar_Usuario(_Ent_Usuario, _Ent_Usuario.ClaveEntidad) == true) { try { Negocio.Reportes rep = new Negocio.Reportes(); rep._Ent_Usuario = new ReportesArg { _Ent_Usuario = _Ent_Usuario }; rep.Proc = Negocio.Reportes.Procedimientos.spt_Asignacion_SEL_Reporte_De_Asignaciones; rep.Busqueda(); if (rep.datos != null) { gvReporte.DataSource = rep.datos; gvReporte.DataBind(); gvReporte.Visible = true; lblMensaje.Visible = false; } else { gvReporte.Visible = false; lblMensaje.Visible = true; } } catch { gvReporte.Visible = false; lblMensaje.Visible = true; } } else { gvReporte.Visible = false; lblMensaje.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["Info_User"] = new Ent_Usuario(); CargarListados(); Encabezado(); CargarAsignaciones(); } }
protected void Page_Load(object sender, EventArgs e) { Negocio.Ent_Usuario _Ent_Usuario = (Ent_Usuario)Session["Info_User"]; Buscar(_Ent_Usuario); }