protected void Listar(string nombre, string proceso) { string estado = string.Empty; if (ddlEstados.SelectedIndex == 0) { estado = string.Empty; } else { estado = ddlEstados.SelectedValue.ToString(); } BL_RESPONSABLE_PROCESOS obj = new BL_RESPONSABLE_PROCESOS(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS_POR_ID(estado, nombre, proceso); if (dtResultado.Rows.Count > 0) { GridView1.Visible = true; GridView1.DataSource = dtResultado; GridView1.DataBind(); } else { GridView1.Visible = false; GridView1.DataSource = dtResultado; GridView1.DataBind(); } }
protected void btnAgregar_Click(object sender, EventArgs e) { int todos; if (CheckTodos.Checked) { todos = 1; } else { todos = 0; } BE_RESPONSABLE_PROCESOS oBESol = new BE_RESPONSABLE_PROCESOS(); oBESol.IDE_RESPONSABLE = 0; oBESol.DNI_RESPONSABLE = ddlPersonal.SelectedValue.ToString(); oBESol.IP_CENTRO = ddlGerencia.SelectedValue; oBESol.GERENCIA = ddlGerencia.SelectedValue; oBESol.CENTRO = ddlCentro.SelectedValue; oBESol.TIPO = ddlProceso.SelectedItem.Text; oBESol.IDE_PROCESO = Convert.ToInt32(ddlProceso.SelectedValue.ToString()); oBESol.TODOS = todos; oBESol.IDE_EMPRESA = Convert.ToInt32(ddlEmpresas.SelectedValue.ToString()); int dtrpta = 0; dtrpta = new BL_RESPONSABLE_PROCESOS().uspINS_RESPONSABLE_PROCESOS(oBESol); if (dtrpta > 0) { string cleanMessage = "Registro satisfactorio"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); Listar("", ""); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { IDE_PERMISO = Request.QueryString["Requ_Numero"]; BL_RESPONSABLE_PROCESOS obj = new BL_RESPONSABLE_PROCESOS(); dtPersonal.Columns.AddRange(new DataColumn[2] { new DataColumn("Row", typeof(string)), new DataColumn("CORREO", typeof(string)) }); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RESPONSABLE_PROCESOS_POR_ID("", "", "ENVIAR CORREO MDP/RRHH"); if (dtResultado.Rows.Count > 0) { for (int i = 0; i < dtResultado.Rows.Count; i++) { int nro = Convert.ToInt32(dtResultado.Rows[i]["Row"].ToString()); string correo = dtResultado.Rows[i]["CORREO"].ToString(); dtPersonal.Rows.Add(nro, correo); } } Session["datos"] = dtPersonal; Listar(); } }