예제 #1
0
 //////////////////////////////////////////////////////////////-EVENTOS-////////////////////////////////////////////////////////
 protected void Page_Load(object sender, EventArgs e)
 {
     M   = mast.M;
     L   = mast.L;
     S   = mast.S;
     F   = mast.F;
     U   = mast.U;
     P   = mast.P;
     dic = new Diccionario(L, S);
     P   = (String)Session["P"];
     mst = (mast)Master;
     APD = new BDAPAD();
     mst.contentCallEvent += new EventHandler(accionar);
     if (String.IsNullOrEmpty(P))
     {
         string notiene;
         if (L == "es")
         {
             notiene = "No has seleccionado ningún padrino";
         }
         else
         {
             notiene = "You have not selected any sponsors";
         }
         numAccion = 1;
         mst.mostrarMsjOpcionMdl(notiene);
     }
     else
     {
         if (!IsPostBack)
         {
             try
             {
                 BDM = new BDMiembro();
                 APD = new BDAPAD();
                 traducir();
                 llenarhistorial();
                 apadrinado();
             }
             catch (Exception ex)
             {
                 mst.mostrarMsjAdvNtf("Error: " + ex.Message);
             }
         }
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     M   = mast.M;
     L   = mast.L;
     S   = mast.S;
     F   = mast.F;
     U   = mast.U;
     P   = mast.P;
     mst = (mast)Master;
     BDM = new BDMiembro();
     APD = new BDAPAD();
     dic = new Diccionario(L, S);
     P   = (String)Session["P"];
     mst.contentCallEvent += new EventHandler(accionar);
     if (String.IsNullOrEmpty(P))
     {
         string mensaje;
         if (L == "es")
         {
             mensaje = "No has seleccionado ningún padrino";
         }
         else
         {
             mensaje = "You have not selected any sponsors";
         }
         mst.mostrarMsjOpcionMdl(mensaje);
     }
     if (!IsPostBack)
     {
         try
         {
             LlenarInformacion();
             Apadrinados();
         }
         catch (Exception ex)
         {
         }
     }
 }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     M   = mast.M;
     L   = mast.L;
     S   = mast.S;
     F   = mast.F;
     U   = mast.U;
     P   = mast.P;
     P   = (String)Session["P"];
     mst = (mast)Master;
     BDM = new BDMiembro();
     APD = new BDAPAD();
     dic = new Diccionario(L, S);
     mst.contentCallEvent += new EventHandler(accionar);
     if (string.IsNullOrEmpty(P))
     {
         string notiene;
         if (L == "es")
         {
             notiene = "No has seleccionado ningún padrino";
         }
         else
         {
             notiene = "You have not selected any sponsors";
         }
         numAccion = 1;
         mst.mostrarMsjOpcionMdl(notiene);
     }
     if (!Page.IsPostBack)
     {
         try
         {
             valoresiniciales();
         }
         catch (Exception ex)
         {
         }
     }
 }
예제 #4
0
        //////////////////////////////////////////////////////--FUNCIONES Y PROCEDIMIENTOS--//////////////////////////////////////////


        protected void btnbuscar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtedad.Text) && ddlgrado.SelectedIndex == 0 && ddlnivel.SelectedIndex == 0 && ddlpueblo.SelectedIndex == 0)
            {
                Ingreso.Visible   = false;
                historial.Visible = true;
                string    sql       = "SELECT MSI.MemberId,M.FirstNames +' '+M.LastNames Nombre, dbo.fn_GEN_edad(M.BirthDate, 'es') Edad, F.Address Vivienda, M.LastFamilyId, dbo.fn_BECA_InfoEducUltimo(MSI.Project,MSI.MemberId) Grado , F.Pueblo, CASE WHEN ''='' THEN L.DescSpanish ELSE L.DescEnglish END Tipo,CASE WHEN ''='' THEN SR.DescSpanish ELSE SR.DescEnglish END Restriccion, CONVERT(VARCHAR,MSI.RestrictionDate,101) Tiempo FROM dbo.MiscMemberSponsorInfo MSI INNER JOIN dbo.Member M ON MSI.MemberId=M.MemberId AND MSI.Project=M.Project AND MSI.RecordStatus=M.RecordStatus LEFT JOIN dbo.CdSponsorShipRestriction SR ON MSI.Restriction = SR.Code LEFT JOIN dbo.CdGrade G ON M.LastGradePassed = G.Code INNER JOIN dbo.Family F ON M.LastFamilyId = F.FamilyId INNER JOIN dbo.CdSponsorShipLevel L ON MSI.SponsorShipLevel = L.Code AND MSI.RecordStatus=F.RecordStatus AND MSI.Project=F.Project WHERE M.RecordStatus = ' ' AND M.Project = '" + S + "' AND M.AffiliationStatus = 'AFIL' AND (MSI.SponsorshipLevel NOT IN ('COMP', 'OLD') AND (MSI.SponsorshipLevel IN ('NING','PARC')))ORDER BY MSI.MemberId ASC";
                DataTable tabledata = new DataTable();
                con.Open();
                SqlDataAdapter adaptador = new SqlDataAdapter(sql, con);
                DataSet        setDatos  = new DataSet();
                adaptador.Fill(setDatos, "listado");
                tabledata = setDatos.Tables["listado"];
                con.Close();
                gvhistorial.DataSource = tabledata;
                gvhistorial.DataBind();
                gvhistorial.Visible = true;
                //    //  LLenarhistorial(sql);
            }
            else
            {
                string edad, pueblo, nivel, grado;

                if (string.IsNullOrEmpty(txtedad.Text))
                {
                    edad = "AND M.BirthDate=M.BirthDate ";
                }
                else
                {
                    edad = "AND dbo.fn_GEN_edad(M.BirthDate, 'es') LIKE('" + txtedad.Text + "%') ";
                }
                if (ddlgrado.SelectedIndex == 0)
                {
                    grado = " ";
                }
                else
                {
                    grado = " AND dbo.fn_BECA_InfoEducUltimo(MSI.Project,MSI.MemberId) LIKE('%" + ddlgrado.SelectedItem.Text + "%') ";
                }
                if (ddlnivel.SelectedIndex == 0)
                {
                    nivel = " AND MSI.SponsorshipLevel=MSI.SponsorshipLevel ";
                }
                else
                {
                    nivel = " AND (MSI.SponsorshipLevel = '" + ddlnivel.SelectedValue + "') ";
                }
                if (ddlpueblo.SelectedIndex == 0)
                {
                    pueblo = "AND F.Pueblo=F.Pueblo";
                }
                else
                {
                    pueblo = "AND F.Pueblo = '" + ddlpueblo.SelectedItem.Text + "' ";
                }
                try
                {
                    string    sql       = "SELECT MSI.MemberId,M.FirstNames +' '+M.LastNames Nombre,dbo.fn_GEN_edad(M.BirthDate, 'es') Edad, F.Address Vivienda, M.LastFamilyId,dbo.fn_BECA_InfoEducUltimo(MSI.Project,MSI.MemberId) Grado , F.Pueblo, CASE WHEN ''='' THEN L.DescSpanish ELSE L.DescEnglish END Tipo, CASE WHEN ''='' THEN SR.DescSpanish ELSE SR.DescEnglish END Restriccion, CONVERT(VARCHAR,MSI.RestrictionDate,101) Tiempo FROM dbo.MiscMemberSponsorInfo MSI INNER JOIN dbo.Member M ON MSI.MemberId=M.MemberId AND MSI.Project=M.Project AND MSI.RecordStatus=M.RecordStatus LEFT JOIN dbo.CdSponsorShipRestriction SR ON MSI.Restriction = SR.Code LEFT JOIN dbo.CdGrade G ON M.LastGradePassed = G.Code INNER JOIN dbo.Family F ON M.LastFamilyId = F.FamilyId INNER JOIN dbo.CdSponsorShipLevel L ON MSI.SponsorShipLevel = L.Code AND MSI.RecordStatus=F.RecordStatus AND MSI.Project=F.Project WHERE M.RecordStatus = ' ' AND M.Project = '" + S + "' AND M.AffiliationStatus = 'AFIL' AND (MSI.SponsorshipLevel NOT IN ('COMP', 'OLD')) " + nivel + " " + edad + " " + pueblo + " " + grado + " ORDER BY MSI.MemberId ASC";
                    DataTable tabledata = new DataTable();
                    con.Open();
                    SqlDataAdapter adaptador = new SqlDataAdapter(sql, con);
                    DataSet        setDatos  = new DataSet();
                    adaptador.Fill(setDatos, "listado");
                    tabledata = setDatos.Tables["listado"];
                    con.Close();
                    gvhistorial.DataSource = tabledata;
                    gvhistorial.DataBind();
                    gvhistorial.Visible = true;
                    if (tabledata.Rows.Count == 0)
                    {
                        eleccion = 1;
                        mst.mostrarMsjOpcionMdl(dic.msjNoEncontroResultados);
                    }
                    else
                    {
                        Ingreso.Visible   = false;
                        historial.Visible = true;
                    }
                }
                catch (Exception ex)
                {
                    string sql = "SELECT MSI.MemberId,M.FirstNames +' '+M.LastNames Nombre,dbo.fn_GEN_edad(M.BirthDate, 'es') Edad, F.Address Vivienda, M.LastFamilyId,dbo.fn_BECA_InfoEducUltimo(MSI.Project,MSI.MemberId) Grado , F.Pueblo, CASE WHEN ''='' THEN L.DescSpanish ELSE L.DescEnglish END Tipo, CASE WHEN ''='' THEN SR.DescSpanish ELSE SR.DescEnglish END Restriccion, CONVERT(VARCHAR,MSI.RestrictionDate,101) Tiempo FROM dbo.MiscMemberSponsorInfo MSI INNER JOIN dbo.Member M ON MSI.MemberId=M.MemberId AND MSI.Project=M.Project AND MSI.RecordStatus=M.RecordStatus LEFT JOIN dbo.CdSponsorShipRestriction SR ON MSI.Restriction = SR.Code LEFT JOIN dbo.CdGrade G ON M.LastGradePassed = G.Code INNER JOIN dbo.Family F ON M.LastFamilyId = F.FamilyId INNER JOIN dbo.CdSponsorShipLevel L ON MSI.SponsorShipLevel = L.Code AND MSI.RecordStatus=F.RecordStatus AND MSI.Project=F.Project WHERE M.RecordStatus = ' ' AND M.Project = '" + S + "' AND M.AffiliationStatus = 'AFIL' AND (MSI.SponsorshipLevel NOT IN ('COMP', 'OLD') " + nivel + " " + edad + " " + pueblo + " ORDER BY MSI.MemberId ASC";
                    mst.mostrarMsjAdvNtf(dic.msjNoSeRealizoExcp + ex.Message + sql + ".");
                }
            }
        }