protected void ddlCampaignsNames_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlCampaignsNames.SelectedItem.Text != defaultListItem)
            {
                try
                {
                    CampaignJob objCampaignJob = new CampaignJob(ConnectionString);
                    DataTable dtMailingNames = objCampaignJob.getAllMailingsWithStatusCampaignID(ConnectionString, "CreatedDate", "DESC", 1, Convert.ToInt32(ddlCampaignsNames.SelectedItem.Value));
                    ddlMailingNames.DataSource = dtMailingNames;
                    ddlMailingNames.DataTextField = CampaignMasterFields.CampaignName;
                    ddlMailingNames.DataValueField = CampaignMasterFields.CampaignId;
                    ddlMailingNames.DataBind();
                    //add default list item as first item
                    ddlMailingNames.Items.Insert(0, defaultListItem);
                    Session["CampId"] = ddlCampaignsNames.SelectedValue;
                    hdfCampaignID.Value = ddlCampaignsNames.SelectedValue.ToString();

                    lblCampaignTitle.Text = ddlCampaignsNames.SelectedItem.Text.ToString().Trim();
                    Session["TitleName"] = lblCampaignTitle.Text;

                    #region Bellow Region to Clear the PrivousChart and Counts
                    lblsentDateTime.Text = string.Empty;
                    Session["MailingID"] = null;
                    hdfMailingID.Value = "";
                    bindReport();
                    #endregion
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                #region Bellow Region to Clear the PrivousChart and Counts
                lblCampaignTitle.Text = string.Empty;
                lblsentDateTime.Text = string.Empty;

                lblTotalBounces.Text = "0";
                lblSoftBounces.Text = "0";
                lblHardBounces.Text = "0";

                lblTotalopens.Text = "0";
                lbluniqueopens.Text = "0";

                lblTotalClicks.Text = "0";
                lbluniqueclicks.Text = "0";

                lblNeverOptedintoList.Text = "0";
                lblToofreequentCommunication.Text = "0";
                lblNotinsertedinmaterial.Text = "0";
                lblOther.Text = "0";

                Session["CampId"] = null;
                Session["MailingID"] = null;
                bindMailingNames();
                ddlMailingNames.SelectedIndex = 0;
                hdfMailingID.Value = string.Empty;
                hdfCampaignID.Value = string.Empty;
                bindReport();
                #endregion
            }
        }
 protected void bindMialingNameswithSeletedCamp()
 {
     CampaignJob objCampaignJob = new CampaignJob(ConnectionString);
     DataTable dtMailingNames = objCampaignJob.getAllMailingsWithStatusCampaignID(ConnectionString, "CreatedDate", "DESC", 1, Convert.ToInt32(Session["CampId"].ToString()));
     ddlMailingNames.DataSource = dtMailingNames;
     ddlMailingNames.DataTextField = CampaignMasterFields.CampaignName;
     ddlMailingNames.DataValueField = CampaignMasterFields.CampaignId;
     ddlMailingNames.DataBind();
     //add default list item as first item
     ddlMailingNames.Items.Insert(0, defaultListItem);
     if (Session["MailingID"] != null)
         ddlMailingNames.Items.FindByValue(Session["MailingID"].ToString()).Selected = true;
 }
        //Anwar 23rd Jan,2012
        protected void ddlCampaignsNames_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlCampaignsNames.SelectedItem.Text != defaultListItem)
            {
                try
                {
                    CampaignJob objCampaignJob = new CampaignJob(ConnectionString);
                    DataTable dtMailingNames = objCampaignJob.getAllMailingsWithStatusCampaignID(ConnectionString, "CreatedDate", "DESC", 1, Convert.ToInt32(ddlCampaignsNames.SelectedItem.Value));
                    ddlMailingNames.DataSource = dtMailingNames;
                    ddlMailingNames.DataTextField = CampaignMasterFields.CampaignName;
                    ddlMailingNames.DataValueField = CampaignMasterFields.CampaignId;
                    ddlMailingNames.DataBind();
                    //add default list item as first item
                    ddlMailingNames.Items.Insert(0, defaultListItem);

                    lblCampaignTitle.Text = ddlCampaignsNames.SelectedItem.Text.ToString().Trim();
                    Session["TitleName"] = lblCampaignTitle.Text;

                    Session["CampId"] = ddlCampaignsNames.SelectedValue;
                    hdfCampaignID.Value = ddlCampaignsNames.SelectedValue.ToString();

                    lblsentDateTime.Text = string.Empty;
                    Session["MailingID"] = null;
                    hdfMailingID.Value = "";

                    bindGrid();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                lblCampaignTitle.Text = string.Empty;
                lblsentDateTime.Text = string.Empty;
                Session["TitleName"] = null;
                Session["SentDateTime"] = null;
                bindMailingNames();
                ddlMailingNames.SelectedIndex = 0;
                Session["CampId"] = null;
                Session["MailingID"] = null;
                bindGrid();
            }
        }
 protected void ddlCampaignsNames_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlCampaignsNames.SelectedItem.Text != defaultCampItem)
     {
         try
         {
             lblCampaignTitle.Text = ddlCampaignsNames.SelectedItem.Text;
             CampaignJob objCampaignJob = new CampaignJob(ConnectionString);
             DataTable dtMailingNames = objCampaignJob.getAllMailingsWithStatusCampaignID(ConnectionString, "CompletionTime", "DESC", 1, Convert.ToInt32(ddlCampaignsNames.SelectedItem.Value));
             ddlMailingNames.DataSource = dtMailingNames;
             ddlMailingNames.DataTextField = CampaignMasterFields.CampaignName;
             ddlMailingNames.DataValueField = CampaignMasterFields.CampaignId;
             ddlMailingNames.DataBind();
             ddlMailingNames.Items.Insert(0, defaultMailingItem);
             Session["CampId"] = ddlCampaignsNames.SelectedValue;
             hdfCampaignID.Value = ddlCampaignsNames.SelectedValue.ToString();
             #region Bellow Region to Clear the PrivousChart and Counts
             lblsentDateTime.Text = string.Empty;
             lblSelectedList.Text = string.Empty;
             lblSubject.Text = string.Empty;
             Session["MailingID"] = null;
             Session["ContactsTargeted"] = null;
             hdfMailingID.Value = string.Empty;
             SingleMailingCounts(hdfCampaignID.Value, hdfMailingID.Value);
             #endregion
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
     else
     {
         Session["CampId"] = null;
         Session["MailingID"] = null;
         bindMailingNames();
         ddlMailingNames.SelectedIndex = 0;
         hdfMailingID.Value = string.Empty;
         hdfCampaignID.Value = string.Empty;
         SingleMailingCounts(hdfCampaignID.Value, hdfMailingID.Value);
     }
 }
        protected void ddlCampaignsNames_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlCampaignsNames.SelectedItem.Text != defaultListItem)
            {
                try
                {
                    CampaignJob objCampaignJob = new CampaignJob(ConnectionString);
                    DataTable dtMailingNames = objCampaignJob.getAllMailingsWithStatusCampaignID(ConnectionString, "CreatedDate", "DESC", 1, Convert.ToInt32(ddlCampaignsNames.SelectedItem.Value));
                    ddlMailingNames.DataSource = dtMailingNames;
                    ddlMailingNames.DataTextField = CampaignMasterFields.CampaignName;
                    ddlMailingNames.DataValueField = CampaignMasterFields.CampaignId;
                    ddlMailingNames.DataBind();
                    //add default list item as first item
                    ddlMailingNames.Items.Insert(0, defaultListItem);
                    Session["CampId"] = ddlCampaignsNames.SelectedValue;
                    hdfCampaignID.Value = ddlCampaignsNames.SelectedValue.ToString();

                    lblCampaignTitle.Text = ddlCampaignsNames.SelectedItem.Text.ToString().Trim();
                    Session["TitleName"] = lblCampaignTitle.Text;

                    #region Bellow Region to Clear the PrivousChart and Counts
                    lblsentDateTime.Text = string.Empty;
                    Session["MailingID"] = null;
                    hdfMailingID.Value = "";
                    bindRecipientDomainsCount(0, "Targeted");
                    rgdAdvanced.Rebind();
                    bindChartDomainsCount("Targeted");
                    #endregion
                    chartAdvanced.Titles[0].Text = "Domains Targeted";
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                bindMailingNames();
                ddlMailingNames.SelectedIndex = 0;
                lblCampaignTitle.Text = string.Empty;
                lblsentDateTime.Text = string.Empty;
                Session["TitleName"] = null;
                Session["SentDateTime"] = null;
                Session["CampId"] = null;
                Session["MailingID"] = null;
                bindRecipientDomainsCount(0, "Targeted");
                rgdAdvanced.Rebind();
                bindChartDomainsCount("Targeted");
            }
        }