void FillGridTodays_Activity()
    {
        if ((string)Session["AdminSessionID"] != null)
        {
            SqlDataAdapter GDA = new SqlDataAdapter(" " +

                                                    " select Code, NextADate=convert(varchar(11),NextActionDate,105), ActionTime " +
                                                    " ,Activity=isnull((select Name from fp_combodetail where Code=am.Activity),'No Activity') " +
                                                    " ,ActivityCode=isnull(Activity,-1) " +
                                                    " ,ClientName=(select Name from fp_prospects where Code=am.ClientCode ) " +
                                                    " ,ClientPhone = (select Mobile1 from fp_prospects where Code=am.ClientCode ) " +
                                                    " ,ClientEmail = (select Email1 from fp_prospects where Code=am.ClientCode ) " +
                                                    " ,AMStatus=isnull(AMStatus,'Open') " +
                                                    " from fp_ActivityMonitor am " +
                                                    " where  PlannerCode=(select code from fp_Planner where userid='" + ViewState["xUserID"] + "') " +
                                                    " and NextActionDate between dateadd(dd,-3,getdate()) and getdate()+1  order by NextActionDate desc " +
                                                    "  ", Con);

            DataSet GDS = new DataSet();
            Con.Open();
            GDA.Fill(GDS);
            Con.Close();

            GVToDaysActivity.DataSource = GDS;
            GVToDaysActivity.DataBind();
        }
        else
        {
            Response.Redirect("SessionExpired.aspx");
        }
    }
    protected void btnActivitySearch_Click(object sender, System.EventArgs e)
    {
        if ((string)Session["AdminSessionID"] != null)
        {
            String xADate = searchDate.Text;
            xADate = "'" + xADate.Substring(6, 4) + '-' + xADate.Substring(3, 2) + '-' + xADate.Substring(0, 2) + "'";

            SqlDataAdapter GDA = new SqlDataAdapter(" " +

                                                    " select Code, NextADate=convert(varchar(11),NextActionDate,105), ActionTime " +
                                                    " ,Activity=isnull((select Name from fp_combodetail where Code=am.Activity),'No Activity') " +
                                                    " ,ActivityCode=isnull(Activity,-1) " +
                                                    " ,ClientName=(select Name from fp_prospects where Code=am.ClientCode ) " +
                                                    " ,ClientPhone = (select Mobile1 from fp_prospects where Code=am.ClientCode ) " +
                                                    " ,ClientEmail = (select Email1 from fp_prospects where Code=am.ClientCode ) " +
                                                    " ,AMStatus=isnull(AMStatus,'Open') " +
                                                    " from fp_ActivityMonitor am " +
                                                    " where  PlannerCode=(select code from fp_Planner where userid='" + ViewState["xUserID"] + "') " +
                                                    " and NextActionDate=" + xADate + "  order by NextActionDate desc " +
                                                    "  ", Con);

            DataSet GDS = new DataSet();
            Con.Open();
            GDA.Fill(GDS);
            Con.Close();

            GVToDaysActivity.DataSource = GDS;
            GVToDaysActivity.DataBind();
        }
        else
        {
            Response.Redirect("SessionExpired.aspx");
        }
    }