mercredi 29 mars 2017

send email based on this condition

plz some 1 help can u tell me how to send email based on this condition

explain:- this condition will only view before 45 days expire i want send email base on the condition down. Thank u ....

  protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{


    GridView1.Columns[4].Visible = false;


      Label a = e.Row.FindControl("Label2") as Label;
      Label b = e.Row.FindControl("Label3") as Label;

    if ((a != null) & (b!= null))
    {
        DateTime lblDate;
        if ((!DateTime.TryParse(a.Text, out lblDate)) & (!DateTime.TryParse(b.Text, out lblDate)))
        {
            // date time conversion not success 
            // you may have empty or invalid datetime 
            // do something in this case 
            return;
        }

        if (lblDate <= DateTime.Today.AddDays(45))
        {

            e.Row.Visible = true;

        }

        else
        {
            e.Row.Visible = false;

        }


          }
           }

Aucun commentaire:

Enregistrer un commentaire