protected void btnNuevaBusqueda_Click(object sender, EventArgs e)
 {
     pnlAsignar.Visible    = false;
     ddlArea.SelectedValue = "";
     ddlTS.SelectedValue   = "";
     pnlBuscar.Visible     = true;
     //iniciarElementos();
     mst.redir("~/TS/AsignacionTSGrupo.aspx");
 }
        //////////////////////////////////////////////////////--FUNCIONES Y PROCEDIMIENTOS--////////////////////////////////////////////
        protected void accionar(object sender, EventArgs e)
        {
            switch (numAccion)
            {
            case 1:
                mst.redir("BusquedaPadrinosAPAD.aspx");
                break;

            case 2:
                try
                {
                    string        nombre    = HttpUtility.HtmlDecode(lblVnombre.Text.Replace(dic.nombre + " : ", ""));
                    string        sql       = "SELECT MemberId miembro FROM dbo.Member WHERE RecordStatus=' ' AND FirstNames+' '+LastNames =@nombre";
                    DataTable     tabledata = new DataTable();
                    SqlConnection conexion  = new SqlConnection(ConnectionString);
                    conexion.Open();
                    SqlCommand comando = new SqlCommand(sql, conexion);
                    comando.Parameters.AddWithValue("@nombre", nombre);
                    SqlDataAdapter adaptador = new SqlDataAdapter();
                    adaptador.SelectCommand = comando;

                    adaptador.Fill(tabledata);
                    conexion.Close();

                    string conteo = tabledata.Rows[0]["miembro"].ToString();

                    string sql2       = "INSERT dbo.SponsorMemberVisit SELECT Project,SponsorId,MemberId,VisitDateTime,GETDATE() CreationDateTime,'H' RecordStatus,'" + U + "' UserId,GETDATE() ExpirationDateTime, Notes FROM dbo.SponsorMemberVisit WHERE RecordStatus=' ' AND SponsorId='" + P + "' AND MemberId='" + conteo + "' AND CONVERT(VARCHAR,VisitDateTime,120)='" + txtfechav.Text + "' AND Notes='" + lblvalornotas.Text + "'";
                    string actualizar = "UPDATE dbo.SponsorMemberVisit SET RecordStatus='H', ExpirationDateTime=GETDATE() WHERE RecordStatus=' ' AND SponsorId='" + P + "' AND MemberId='" + conteo + "' AND CONVERT(VARCHAR,VisitDateTime,120)='" + txtfechav.Text + "' AND Notes='" + lblvalornotas.Text + "'";

                    SqlCommand cmd3 = null;
                    cmd3 = new SqlCommand(actualizar, con);
                    SqlCommand cmd4 = null;
                    cmd4 = new SqlCommand(sql2, con);
                    con.Open();
                    int fil  = cmd4.ExecuteNonQuery();
                    int fil2 = cmd3.ExecuteNonQuery();
                    if (fil < 0)
                    {
                        mst.mostrarMsjAdvNtf("errorsql2");
                    }
                    if (fil2 < 0)
                    {
                        mst.mostrarMsjAdvNtf("erroractualizar");
                    }
                    limpiarCampos();
                    llenarhistorial();
                    traducir();
                    mst.mostrarMsjNtf(dic.msjSeHaEliminado);
                }
                catch (Exception ex)
                {
                    mst.mostrarMsjAdvNtf(dic.msjNoSeRealizoExcp + ex.Message.ToString() + ".");
                }
                break;
            }
        }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         U = mast.U;
         L = mast.L;
         S = mast.S;
         if (S.Equals("E") || S.Equals("A"))
         {
             mst.redir("MISC/Buscar.aspx");
         }
         bdGEN = new BDGEN();
         dic   = new Diccionario(L, S);
         colocarNombres();
     }
     mst = (mast)Master;
 }