Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Tipo_Rale.AppendDataBoundItems = true;
         String        strQuery = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Rales_Combo]";
         SqlConnection con      = new SqlConnection(strConnString);
         SqlCommand    cmd      = new SqlCommand();
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = strQuery;
         cmd.Connection  = con;
         try
         {
             con.Open();
             Tipo_Rale.DataSource     = cmd.ExecuteReader();
             Tipo_Rale.DataTextField  = "des";
             Tipo_Rale.DataValueField = "id";
             Tipo_Rale.DataBind();
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             con.Close();
             con.Dispose();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LabelMensaje.Visible           = false;
         Tipo_Rale.AppendDataBoundItems = true;
         String        strQuery = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Rales_Combo]";
         SqlConnection con      = new SqlConnection(strConnString);
         SqlCommand    cmd      = new SqlCommand();
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = strQuery;
         cmd.Connection  = con;
         try
         {
             con.Open();
             Tipo_Rale.DataSource     = cmd.ExecuteReader();
             Tipo_Rale.DataTextField  = "des";
             Tipo_Rale.DataValueField = "id";
             Tipo_Rale.DataBind();
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             con.Close();
             con.Dispose();
         }
     }
     if (!IsPostBack)
     {
         Subdelegacion.AppendDataBoundItems = true;
         try
         {
             this.Subdelegacion.Items.Insert(0, new ListItem("-- Selecione una Subdelegación --", ""));
             this.Subdelegacion.Items.Insert(1, new ListItem("DELEGACIONAL", "3"));
             this.Subdelegacion.Items.Insert(2, new ListItem("TOLUCA", "1"));
             this.Subdelegacion.Items.Insert(3, new ListItem("NAUCALPAN", "5"));
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
         }
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         for (int i = 2005; i < DateTime.Now.Year + 1; i++)
         {
             fecha1.Items.Add(i.ToString());
         }
         for (int i = 2005; i < DateTime.Now.Year + 1; i++)
         {
             fecha2.Items.Add(i.ToString());
         }
     }
     if (!IsPostBack)
     {
         //Literal2.Visible = false;
         Tipo_Rale.AppendDataBoundItems = true;
         String        strQuery = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Ral_Comb_Per]";
         SqlConnection con      = new SqlConnection(strConnString);
         SqlCommand    cmd      = new SqlCommand();
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = strQuery;
         cmd.Connection  = con;
         try
         {
             con.Open();
             Tipo_Rale.DataSource     = cmd.ExecuteReader();
             Tipo_Rale.DataTextField  = "des";
             Tipo_Rale.DataValueField = "id";
             Tipo_Rale.DataBind();
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             con.Close();
             con.Dispose();
         }
     }
 }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Rale1.Items.Clear();
         Rale1.Items.Add(new ListItem("-- Selecciona Anterior --", ""));
         Rale2.Items.Clear();
         Rale2.Items.Add(new ListItem("-- Selecciona Actual --", ""));
         Rale2.Enabled = false;
         TIPO.Items.Clear();
         TIPO.Items.Add(new ListItem("-- Selecciona Subdelegación --", ""));
         Tipo_Rale.Items.Clear();
         incidencia.Items.Clear();
         incidencia.Items.Add(new ListItem("-- Selecciona una Incidencia --", ""));
         Tipo_Rale.Items.Add(new ListItem("-- Selecciona Tipo --", ""));
         Tipo_Rale.AppendDataBoundItems = true;
         String        strConnString = ConfigurationManager.ConnectionStrings["SupervisionConnectionString"].ConnectionString;
         String        strQuery      = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Rales_Combo]";
         SqlConnection con           = new SqlConnection(strConnString);
         SqlCommand    cmd           = new SqlCommand();
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = strQuery;
         cmd.Connection  = con;
         try
         {
             con.Open();
             Tipo_Rale.DataSource     = cmd.ExecuteReader();
             Tipo_Rale.DataTextField  = "des";
             Tipo_Rale.DataValueField = "id";
             Tipo_Rale.DataBind();
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             con.Close();
             con.Dispose();
         }
     }
 }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LabelMensaje.Visible = false;
        Response.Cookies["Tipo_Rale"].Value = "n";
        Response.Cookies["Rale_Base"].Value = "n";
        Response.Cookies["Rale_Comp"].Value = "n";
        Response.Cookies["CC"].Value        = "n";
        Response.Cookies["RA"].Value        = "n";
        Response.Cookies["Per_Ini"].Value   = "n";
        Response.Cookies["Per_Fin"].Value   = "n";

        if (!IsPostBack)
        {
            LabelMensaje.Visible           = false;
            Tipo_Rale.AppendDataBoundItems = true;
            String        strConnString = ConfigurationManager.ConnectionStrings["SupervisionConnectionString"].ConnectionString;
            String        strQuery      = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Rales_Combo]";
            SqlConnection con           = new SqlConnection(strConnString);
            SqlCommand    cmd           = new SqlCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = strQuery;
            cmd.Connection  = con;
            try
            {
                con.Open();
                Tipo_Rale.DataSource     = cmd.ExecuteReader();
                Tipo_Rale.DataTextField  = "des";
                Tipo_Rale.DataValueField = "id";
                Tipo_Rale.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
    }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Tipo_Rale.AppendDataBoundItems = true;
         String        strQuery = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Rales_Combo]";
         SqlConnection con      = new SqlConnection(strConnString);
         SqlCommand    cmd      = new SqlCommand();
         cmd.CommandType = CommandType.Text;
         cmd.CommandText = strQuery;
         cmd.Connection  = con;
         try
         {
             con.Open();
             Tipo_Rale.DataSource     = cmd.ExecuteReader();
             Tipo_Rale.DataTextField  = "des";
             Tipo_Rale.DataValueField = "id";
             Tipo_Rale.DataBind();
             TIPO.Items.Clear();
             TIPO.Items.Add(new ListItem("-- Selecione la Subdelegación --", ""));
             incidencia.Items.Clear();
             incidencia.Items.Add(new ListItem("-- Seleccione Incidencia --", ""));
             incidencia.Enabled = false;
             tipo_doc.Items.Clear();
             tipo_doc.Items.Add(new ListItem("-- Seleccione Tipo de Documento --", "-1"));
             tipo_doc.Enabled = false;
             tipo_mov.Items.Clear();
             tipo_mov.Items.Add(new ListItem("-- Seleccione Tipo de Movimiento --", "-1"));
             tipo_mov.Enabled = false;
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             con.Close();
             con.Dispose();
         }
     }
 }
Ejemplo n.º 7
0
    protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedValue == "1")
        {
            Literal5.Text     = "";
            Panel3.Visible    = false;
            Panel2.Visible    = true;
            GridView1.Visible = false;
            GridView2.Visible = false;
            Rale1.Items.Clear();
            Rale1.Items.Add(new ListItem("-- Selecciona Rale --", ""));
            Rale1.Enabled = false;

            TIPO.Items.Clear();
            TIPO.Items.Add(new ListItem("-- Selecione la Subdelegación --", ""));
            TIPO.Enabled = false;

            incidencia.Items.Clear();
            incidencia.Items.Add(new ListItem("-- Seleccione Incidencia --", ""));
            incidencia.Enabled = false;

            Tipo_Rale.Items.Clear();
            Tipo_Rale.Items.Add(new ListItem("-- Selecciona Tipo de Rale --", ""));
            Tipo_Rale.Enabled = true;
            Tipo_Rale.AppendDataBoundItems = true;
            String        strQuery = "SELECT DISTINCT [tipo_rale] as id,[tipo_rale] as des FROM [Supervision].[dbo].[Rales_Combo]";
            SqlConnection con      = new SqlConnection(strConnString);
            SqlCommand    cmd      = new SqlCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = strQuery;
            cmd.Connection  = con;
            try
            {
                con.Open();
                Tipo_Rale.DataSource     = cmd.ExecuteReader();
                Tipo_Rale.DataTextField  = "des";
                Tipo_Rale.DataValueField = "id";
                Tipo_Rale.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
        else
        {
            if (RadioButtonList1.SelectedValue == "2")
            {
                Literal5.Text                  = "";
                Encabezado.Visible             = false;
                EncabezadoSegundaTabla.Visible = false;
                GridView3.Visible              = false;
                Panel2.Visible                 = false;
                Panel3.Visible                 = true;
                GridView1.Visible              = false;
                Rale2.Items.Clear();
                Reg_Pat.Text = null;
                Rale2.Items.Add(new ListItem("-- Selecciona Rale --", ""));
                Rale2.AppendDataBoundItems = true;
                String        strQuery = "SELECT CONVERT(NVARCHAR, fecha_rale, 105) AS MOSTRAR, CONVERT (NVARCHAR, fecha_rale, 105) AS VALUE, CONVERT (NVARCHAR, fecha_rale, 102) AS VALUE1 FROM Rales_Combo WHERE (tipo_rale = 'COP' ) ORDER BY VALUE1 ASC";
                SqlConnection con      = new SqlConnection(strConnString);
                SqlCommand    cmd      = new SqlCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = strQuery;
                cmd.Connection  = con;
                try
                {
                    con.Open();
                    Rale2.DataSource     = cmd.ExecuteReader();
                    Rale2.DataTextField  = "MOSTRAR";
                    Rale2.DataValueField = "VALUE";
                    Rale2.DataBind();
                    if (Rale2.Items.Count > 1)
                    {
                        Rale2.Enabled = true;
                    }
                    else
                    {
                        Rale2.Enabled = false;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    con.Close();
                    con.Dispose();
                }
            }
        }
    }