public void bindEngagmentRecs(string mailinName, int pageIndex) { Campaign objCampaign = new Campaign(ConnectionString); DataTable EngagLinkUrls = objCampaign.getAllMailingLinkUrls(ConnectionString, mailinName, SortExpression.ToString(), ViewState["SortDirection"].ToString()); EngagLinkUrlsCount = EngagLinkUrls.Rows.Count; rgdClicksReport.DataSource = EngagLinkUrls; rgdClicksReport.DataBind(); }
public void bindAcademicInterestRecs(string mailinName, int pageIndex) { //string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); DataTable academicRecs = objCampaign.getMailingRptByMajors(ConnectionString, mailinName, "Selected_MajorCodeDescription", SortExpression.ToString(), ViewState["SortDirection"].ToString(), pageIndex, 10, out rowCount); RGridAcademicRecs.CurrentPageIndex = pageIndex; RGridAcademicRecs.VirtualItemCount = rowCount; RGridAcademicRecs.DataSource = academicRecs; RGridAcademicRecs.DataBind(); }
public void bindAcademicInterestRecs(string campId, int pageIndex, string fillflag) { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); DataTable academicRecs = objCampaign.getCampaignRptByMajors(ConnectionString, campId, "Selected_MajorCodeDescription", GridSortExpression, sortdir, pageIndex, 10, out rowCount); RGridAcademicRecs.CurrentPageIndex = pageIndex; RGridAcademicRecs.VirtualItemCount = rowCount; RGridAcademicRecs.DataSource = academicRecs; RGridAcademicRecs.DataBind(); GridPrevSortExpression = GridSortExpression; }
protected void lbtnDownload_Click(object sender, EventArgs e) { Export Export = new Export("Web"); DataTable exportTable = null; Campaign objCampaign = new Campaign(ConnectionString); exportTable = objCampaign.getMailingCampaignsCountWithFile(ConnectionString, assignId, "MailingName", "asc", 0, rowCount, out rowCount); exportTable.Columns.Remove("AssignedCampaignName"); exportTable.Columns.Remove("RowRank"); if (exportTable.Rows.Count != 0) Export.ExportDetails(exportTable, Export.ExportFormat.CSV, "CampaignSummary.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); }
public void bindGrid(string fillflag, int pageIndex) { try { Campaign objCampaign = new Campaign(ConnectionString); DataTable campaignJobs = objCampaign.getMailingCampaignsWithCountPageWise(ConnectionString, "CampaignsName", "desc", pageIndex, 10, out rowCount); RGridCampMails.CurrentPageIndex = pageIndex; RGridCampMails.VirtualItemCount = rowCount; RGridCampMails.DataSource = campaignJobs; RGridCampMails.DataBind(); } catch (Exception ex) { throw ex; } }
public void bindGrid(string fillflag, int pageIndex) { try { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); DataTable campaignJobs = objCampaign.getMailingCampaignsPageWise(ConnectionString, GridSortExpression, sortdir, pageIndex, 10, out rowCount); RGridCampMails.CurrentPageIndex = pageIndex; RGridCampMails.VirtualItemCount = rowCount; RGridCampMails.DataSource = campaignJobs; RGridCampMails.DataBind(); GridPrevSortExpression = GridSortExpression; } catch (Exception ex) { throw ex; } }
public void bindEngagmentPieChart(string campId, int pageIndex) { Campaign objCampaign = new Campaign(ConnectionString); DataTable EngagLinkUrls = objCampaign.getTop10MailingLinkUrlsByCampaign(ConnectionString, campId); ArrayList yValues = new ArrayList(EngagLinkUrls.AsEnumerable().Select(row => row.Field<int>("Clicks")).ToArray()); ArrayList percentageValues = new ArrayList(EngagLinkUrls.AsEnumerable().Select(row => row.Field<string>("percentage")).ToArray()); ArrayList LinkNames = new ArrayList(EngagLinkUrls.AsEnumerable().Select(row => row.Field<string>("LinkURL")).ToArray()); //int[] yValues = EngagLinkUrls.AsEnumerable().Select(row => row.Field<int>("Clicks")).ToArray(); //string[] percentageValues = EngagLinkUrls.AsEnumerable().Select(row => row.Field<string>("percentage")).ToArray(); //string[] LinkNames = EngagLinkUrls.AsEnumerable().Select(row => row.Field<string>("LinkURL")).ToArray(); double plotY = 0; ShowCampaignCountChart.Series["Series1"].Points.Clear(); if (yValues.Count != 0) { //yValues.Add(Convert.ToDouble(opencount)); for (int pointIndex = 0; pointIndex < yValues.Count; pointIndex++) { plotY = Convert.ToDouble(yValues[pointIndex]); ShowCampaignCountChart.Series["Series1"].Points.AddY(plotY); ShowCampaignCountChart.Series["Series1"].Points[pointIndex].LabelForeColor = System.Drawing.Color.FromArgb(7, 116, 167);//System.Drawing.Color.RoyalBlue; //ShowCampaignCountChart.Series["Series1"].Points[pointIndex].ToolTip = "Clicks:" + yValues[pointIndex].ToString() + " (" + percentageValues[pointIndex].ToString() + "%" + ")"; ShowCampaignCountChart.Series["Series1"].Points[pointIndex].Label = yValues[pointIndex].ToString() + " (" + percentageValues[pointIndex].ToString() + "%" + ")"; ShowCampaignCountChart.Series["Series1"].Points[pointIndex].ToolTip = LinkNames[pointIndex].ToString(); // Set the pie labels to be drawn outside of the pie chart ShowCampaignCountChart.Series[0]["PieLabelStyle"] = "Outside";//CustomProperties="PieLabelStyle=Outside, PieDrawingStyle=Concave" ShowCampaignCountChart.Series[0]["PieDrawingStyle"] = "Concave"; // Set these other two properties so that you can see the connecting lines //ShowCampaignCountChart.Series[0].BorderWidth = 1; //ShowCampaignCountChart.Series[0].BorderColor = System.Drawing.Color.FromArgb(7, 116, 167); ShowCampaignCountChart.Series["Series1"].Points[pointIndex].Label = yValues[pointIndex].ToString() + " (" + percentageValues[pointIndex].ToString() + "%" + ")"; } } //show Chart ShowCampaignCountChart.Series["Series1"].ChartType = SeriesChartType.Pie; ShowCampaignCountChart.Series["Series1"]["PieStartAngle"] = "30"; yValues.Clear(); percentageValues.Clear(); LinkNames.Clear(); }
protected void Page_Load(object sender, EventArgs e) { ConnectionString = Session["AdvanceTabCon"].ToString(); if (!IsPostBack) { if (Request.QueryString["Page"] != null && Request.QueryString["Rowcount"] != null) { //decrypt = BusinessObject.Encryption.Decrypt(Request.QueryString["Page"]); rowCount = Convert.ToInt32(Request.QueryString["Rowcount"]); if (Request.QueryString["Page"].ToLower() == "campaignsummary") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; DataTable exportTable = null; Campaign objCampaign = new Campaign(ConnectionString); exportTable = objCampaign.getAllCountsOfCampaignsWithFilePagewise(ConnectionString, "CampaignsName", "desc", 0, rowCount, out rowCount); exportTable.Columns.Remove("RowRank"); if (exportTable.Rows.Count != 0) { gvPrint.DataSource = exportTable.DefaultView; gvPrint.DataBind(); } titleName = "Campaign Summary"; } if (Request.QueryString["Page"].ToLower() == "campfilesummary") { Campaign objCampaign = new Campaign(ConnectionString); DataTable campaignJobs = objCampaign.getMailingCampaignsCountWithFile(ConnectionString, "", "MailingName", "asc", 0, rowCount, out rowCount); campaignJobs.Columns.Remove("AssignedCampaignName"); campaignJobs.Columns.Remove("RowRank"); if (campaignJobs.Rows.Count != 0) { gvPrint.DataSource = campaignJobs; gvPrint.DataBind(); } } } } }
public void bindYearOfGradRecs(string mailinName, int pageIndex) { //string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); DataTable yearOfGradRecs = objCampaign.getMailingRptByYearofGrade(ConnectionString, mailinName, "GradYear_4Bytes", SortExpression.ToString(), ViewState["SortDirection"].ToString(), pageIndex, 10, out rowCount); RGridYearOfGradRecs.CurrentPageIndex = pageIndex; RGridYearOfGradRecs.VirtualItemCount = rowCount; RGridYearOfGradRecs.DataSource = yearOfGradRecs; RGridYearOfGradRecs.DataBind(); }
protected void lbtnDownload_Click(object sender, EventArgs e) { if (Session["AdvMailingName"] != null && Session["AdvMailingName"].ToString().Length != 0) { Export Export = new Export("Web"); DataTable exportTable = null; Campaign objCampaign = new Campaign(ConnectionString); string mailinName = Session["AdvMailingName"].ToString(); if (rtsMailingDemographic.SelectedIndex == 0) // Year Of Grad { exportTable = objCampaign.getMailingRptByYearofGrade(ConnectionString, mailinName, "GradYear_4Bytes", "Year", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 1) //Majors { exportTable = objCampaign.getMailingRptByMajors(ConnectionString, mailinName, "Selected_MajorCodeDescription", "Name", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 2) //Soucecode { exportTable = objCampaign.getMailingRptBySourceCode(ConnectionString, mailinName, "SourceCode", "SourceCode", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 3) //Ethnicity { exportTable = objCampaign.getMailingRptByEthnicity(ConnectionString, mailinName, "Ethnicity", "Ethnicity", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 4) //State { exportTable = objCampaign.getMailingRptByState(ConnectionString, mailinName, "State", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 5) // Engagment { exportTable = objCampaign.getAllMailingLinkUrls(ConnectionString, mailinName, "Clicks", "desc"); } if (rtsMailingDemographic.SelectedIndex == 6) // LetterVersion { exportTable = objCampaign.getMailingRptByLetterVersion(ConnectionString, mailinName, "LetterVersion", "LetterVersion", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 7) // Gender { exportTable = objCampaign.getMailingRptByGender(ConnectionString, mailinName, "Gender", "asc", 0, rowCount, out rowCount); } if (rtsMailingDemographic.SelectedIndex == 8) // HighSchoolName { exportTable = objCampaign.getMailingRptBySchool(ConnectionString, mailinName, "HighSchoolName", "HighSchoolName", "asc", 0, rowCount, out rowCount); } if (exportTable.Rows.Count != 0) { if (exportTable.Columns.Contains("RowRank")) exportTable.Columns.Remove("RowRank"); Export.ExportDetails(exportTable, Export.ExportFormat.CSV, rtsMailingDemographic.SelectedTab.Text.Trim() + ".csv"); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } }
protected void lbtnSaveNewCamp_Click(object sender, EventArgs e) { try { lbMsg.Text = string.Empty; Campaign Campaign = new Campaign(ConnectionString); Campaign.CampaignsName = txtCampName.Text; Campaign.CampaignsDesc = txtCampDescription.Text; Campaign.Active = true; DataTable dtCheck = CampaignBase.SelectByField("CampaignsName", txtCampName.Text.ToString(), ConnectionString); if (dtCheck.Rows.Count > 0) { throw new Exception(string.Format("Campaign: {0}, already exists. Please enter other name.", txtCampName.Text)); } Campaign.CreatedDate = System.DateTime.Now; Campaign.ModifiedDate = System.DateTime.Now; lblMainMsg.ForeColor = Color.Green; lblMainMsg.Text = string.Format(Campaign.Insert() == true ? "Campaign {0} Created Successfully." : "Mailing {0} Created Failed.", txtCampName.Text); bindCampNames(); } catch (Exception ex) { CreateCampPopup.Show(); lbMsg.Text = "Error: " + ex.Message; } }
public void bindStateGraph(string mailinName, int pageIndex) { Campaign objCampaign = new Campaign(ConnectionString); DataTable stateRecs = objCampaign.getMailingRptByState(ConnectionString, mailinName, "UniqueEmailClicks", "asc", pageIndex, 10, out rowCount); //Convert DataTable to ArrayList. string[] stateNames = stateRecs.AsEnumerable().Select(row => row.Field<string>("State")).ToArray(); int[] emailClicks = stateRecs.AsEnumerable().Select(row => row.Field<int>("UniqueEmailClicks")).ToArray(); double plotX = 0.0; if (stateNames.Length > 0) { for (int pointIndex = 0; pointIndex < stateNames.Length; pointIndex++) { if (pointIndex == 9) break; plotX = Convert.ToDouble(emailClicks[pointIndex]); ShowStateChart.Series["Series1"].Points.AddY(plotX); ShowStateChart.Series["Series1"].Points[pointIndex].AxisLabel = stateNames[pointIndex]; ShowStateChart.Series["Series1"].Points[pointIndex].Label = emailClicks[pointIndex].ToString(); ShowStateChart.Series["Series1"].Points[pointIndex].LabelToolTip = stateNames[pointIndex]; } } ShowStateChart.Series["Series1"].ChartType = SeriesChartType.Bar; ShowStateChart.Series["Series1"]["DrawingStyle"] = "Cylinder"; }
public void bindSchoolRecs(string campId, int pageIndex, string fillflag) { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); //HighSchoolName DataTable schoolRecs = objCampaign.getCampaignRptBySchool(ConnectionString, campId, "HighSchoolName", GridSortExpression, sortdir, pageIndex, 10, out rowCount); RadGridHighSchoolRecs.CurrentPageIndex = pageIndex; RadGridHighSchoolRecs.VirtualItemCount = rowCount; RadGridHighSchoolRecs.DataSource = schoolRecs; RadGridHighSchoolRecs.DataBind(); GridPrevSortExpression = GridSortExpression; }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of Campaigns</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 6/25/2012 02:05:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static Campaigns PopulateObjectsFromReader(IDataReader rdr, string ConnectionString) { Campaigns list = new Campaigns(); while (rdr.Read()) { Campaign obj = new Campaign(ConnectionString); PopulateObjectFromReader(obj,rdr); list.Add(obj); } return list; }
// Edit protected void lbSaveCamp_Click(object sender, EventArgs e) { try { string campName = txtEditCampName.Text.ToString(); DataTable dtCheck = CampaignBase.SelectByField("CampaignsName", txtEditCampName.Text.ToString(), ConnectionString); Campaign objCampaign = new Campaign(ConnectionString); objCampaign.CampaignsName = txtEditCampName.Text; objCampaign.CampaignsDesc = txtEditCampDescription.Text; if (Convert.ToInt64(hiddenEditID.Value) > 0) { objCampaign.ID = Convert.ToInt64(hiddenEditID.Value); if (dtCheck.Rows.Count > 0 && Convert.ToInt64(dtCheck.Rows[0]["ID"]) != Convert.ToInt64(hiddenEditID.Value)) { lbMsgForEdit.Text = "Campaign:" + txtEditCampName.Text + ", already exists. Please enter other name."; MpextDivEdit.Show(); } else { CampaignPrimaryKey pk = new CampaignPrimaryKey(Convert.ToInt64(hdId.Value.ToString())); Campaign CampNew = Campaign.SelectOne(pk, ConnectionString); Campaign = new Campaign(ConnectionString); Campaign.ID = Convert.ToInt64(hdId.Value.ToString()); Campaign.CampaignsName = txtEditCampName.Text.ToString().Trim(); Campaign.CampaignsDesc = txtEditCampDescription.Text.ToString().Trim(); Campaign.CreatedDate = CampNew.CreatedDate; Campaign.ModifiedDate = DateTime.Now; Campaign.Active = true; if (Campaign.Update() == true) { lblMainMsg.Text = string.Format("Campaign: {0} Updated Successfully.", Server.HtmlEncode(txtEditCampName.Text)); bindGrid(string.Empty, RGridCampMails.CurrentPageIndex); } else { lblMainMsg.Text = string.Format("Campaign: {0} Updation Failed.", Server.HtmlEncode(txtEditCampName.Text)); } } } } catch (Exception ex) { throw ex; } }
public void bindGenderRecs(string mailinName, int pageIndex) { Campaign objCampaign = new Campaign(ConnectionString); DataTable genderRecs = objCampaign.getMailingRptByGender(ConnectionString, mailinName, SortExpression.ToString(), ViewState["SortDirection"].ToString(), pageIndex, 10, out rowCount); RadGridGenderRecs.CurrentPageIndex = pageIndex; RadGridGenderRecs.VirtualItemCount = rowCount; RadGridGenderRecs.DataSource = genderRecs; RadGridGenderRecs.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { ConnectionString = Session["AdvanceTabCon"].ToString(); if (!IsPostBack) { if (Request.QueryString["Page"] != null) { rowCount = Request.QueryString["Rowcount"] != null ? Convert.ToInt32(Request.QueryString["Rowcount"]) : rowCount; if (Request.QueryString["Page"].ToLower() == "campaignsummary") { DataTable exportTable = null; Campaign objCampaign = new Campaign(ConnectionString); exportTable = objCampaign.getAllCountsOfCampaignsWithFilePagewise(ConnectionString, "CampaignsName", "desc", 0, rowCount, out rowCount); exportTable.Columns.Remove("RowRank"); if (exportTable.Rows.Count != 0) { gvPrint.DataSource = exportTable.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); titleName = "Campaign Summary"; lblTitle.Text = titleName; } if (Request.QueryString["Page"].ToLower() == "campfilesummary" && Request.QueryString["AssignId"] != null) { string assignId = Request.QueryString["AssignId"] != null ? Request.QueryString["AssignId"] : string.Empty; titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable campaignJobs = objCampaign.getMailingCampaignsCountWithFile(ConnectionString, assignId, "MailingName", "desc", 0, rowCount, out rowCount); campaignJobs.Columns.Remove("AssignedCampaignName"); campaignJobs.Columns.Remove("RowRank"); if (campaignJobs.Rows.Count != 0) { gvPrint.DataSource = campaignJobs; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign Summary:" + ' ' + titleName; } MailingRecords(); } } }
/// <summary> /// Populates the fields for multiple objects from the columns found in an open reader. /// </summary> /// /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param> /// /// <returns>Object of Campaigns</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 6/25/2012 02:05:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// internal static Campaigns PopulateObjectsFromReaderWithCheckingReader(IDataReader rdr, DatabaseHelper oDatabaseHelper, string ConnectionString) { Campaigns list = new Campaigns(); if (rdr.Read()) { Campaign obj = new Campaign(ConnectionString); PopulateObjectFromReader(obj, rdr); list.Add(obj); while (rdr.Read()) { obj = new Campaign(ConnectionString); PopulateObjectFromReader(obj, rdr); list.Add(obj); } oDatabaseHelper.Dispose(); return list; } else { oDatabaseHelper.Dispose(); return null; } }
protected void lbtnDownload_Click(object sender, EventArgs e) { Export Export = new Export("Web"); DataTable dtexportTable = null; Campaign objCampaign = new Campaign(ConnectionString); if (ddlCampaignsNames.SelectedItem.Text != defaultCampItem) { if (Session["AdvCampId"] != null && Session["AdvCampId"].ToString() != string.Empty) { if (rtsCampaigndemographic.SelectedIndex == 0) // Year Of Grad { bindYearOfGradRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptByYearofGrade(ConnectionString, Session["AdvCampId"].ToString(), "GradYear_4Bytes", "Year", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "YearGrade.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 1) //Majors { bindAcademicInterestRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptByMajors(ConnectionString, Session["AdvCampId"].ToString(), "Selected_MajorCodeDescription", "Name", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "Majors.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 2) //Soucecode { bindSourceCodeRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptBySourceCode(ConnectionString, Session["AdvCampId"].ToString(), "SourceCode", "SourceCode", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "SourceCode.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 3) //Ethnicity { bindEthnicityRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptByEthnicity(ConnectionString, Session["AdvCampId"].ToString(), "Ethnicity", "Ethnicity", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "Ethnicity.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 4) //State { bindStateRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptByState(ConnectionString, Session["AdvCampId"].ToString(), "UniqueEmailClicks", "desc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "State.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 5) // Engagment { bindEngagmentRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getAllMailingLinkUrlsByCampaign(ConnectionString, Session["AdvCampId"].ToString(), "Clicks", "desc"); //dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "Engagment.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 6) // LetterVersion { bindLetterVersionRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptByLetterVersion(ConnectionString, Session["AdvCampId"].ToString(), "LetterVersion", "LetterVersion", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "LetterVersion.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 7) // Gender { bindGenderRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptByGender(ConnectionString, Session["AdvCampId"].ToString(), "Gender", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "Gender.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } if (rtsCampaigndemographic.SelectedIndex == 8) // HighSchoolName { bindSchoolRecs(Session["AdvCampId"].ToString(), 0,""); if (Session["AdvCampId"] != null) { dtexportTable = objCampaign.getCampaignRptBySchool(ConnectionString, Session["AdvCampId"].ToString(), "HighSchoolName", "HighSchoolName", "asc", 0, rowCount, out rowCount); dtexportTable.Columns.Remove("RowRank"); } if (dtexportTable.Rows.Count != 0) Export.ExportDetails(dtexportTable, Export.ExportFormat.CSV, "HighSchoolName.csv"); else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); } } } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Download.')", true); }
public void bindYearOfGradRecs(string campId, int pageIndex, string fillflag) { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); DataTable yearOfGradRecs = objCampaign.getCampaignRptByYearofGrade(ConnectionString, campId, "GradYear_4Bytes", GridSortExpression, sortdir, pageIndex, 10, out rowCount); RGridYearOfGradRecs.CurrentPageIndex = pageIndex; RGridYearOfGradRecs.VirtualItemCount = rowCount; RGridYearOfGradRecs.DataSource = yearOfGradRecs; RGridYearOfGradRecs.DataBind(); GridPrevSortExpression = GridSortExpression; }
public void bindStateRecs(string campId, int pageIndex, string fillflag) { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); //"UniqueEmailClicks" DataTable stateRecs = objCampaign.getCampaignRptByState(ConnectionString, campId, GridSortExpression, sortdir, pageIndex, 10, out rowCount); RGridStateRecs.CurrentPageIndex = pageIndex; RGridStateRecs.VirtualItemCount = rowCount; RGridStateRecs.DataSource = stateRecs; RGridStateRecs.DataBind(); GridPrevSortExpression = GridSortExpression; }
public bool SelectedEditUpdateCampaign(Campaign campaign) { bool ExecutionState = false; oDatabaseHelper = new DatabaseHelper(ConnectionString); oDatabaseHelper.AddParameter("@ID", campaign.ID); oDatabaseHelper.AddParameter("@CampaignsDesc", campaign.CampaignsDesc); oDatabaseHelper.AddParameter("@CreatedDate", campaign.CreatedDate); oDatabaseHelper.AddParameter("@ModifiedDate", campaign.ModifiedDate); oDatabaseHelper.AddParameter("@Active", campaign.Active); oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output); oDatabaseHelper.ExecuteScalar("sp_Campaigns_SelectedEditUpdate", ref ExecutionState); oDatabaseHelper.Dispose(); return ExecutionState; }
//lbtnEditMultipleYes_Click protected void lbtnEditMultipleYes_Click(object sender, EventArgs e) { if (RGridCampMails.MasterTableView.Items.Count > 0) { //Get contact Selection rememberCampaignsSelection("PgrdaddchkSelectRecs", "lblDCampaignId", RGridCampMails, "Pgrdaddselectall"); if (ViewState["SelectedContacts"] != null) { StringBuilder strbEditContacts = new StringBuilder(); //adding selected contatIds to stringbuilder for (int i = 0; i < CampaignsSelected.Count; i++) { strbEditContacts.Append(CampaignsSelected[i] + ", "); Campaign campaign = new Campaign(ConnectionString); campaign.ID = Convert.ToInt64(CampaignsSelected[i]); campaign.CampaignsDesc = txtMultiCampaignDesc.Text; CampaignPrimaryKey pk = new CampaignPrimaryKey(Convert.ToInt64(CampaignsSelected[i])); CampaignBase campaignnew = CampaignBase.SelectOne(pk, ConnectionString); campaign.CreatedDate = campaignnew.CreatedDate; campaign.ModifiedDate = System.DateTime.Now; campaign.Active = true; CampaignBase objCampaignBase = new CampaignBase(ConnectionString); objCampaignBase.SelectedEditUpdateCampaign(campaign); } strbEditContacts.Remove(strbEditContacts.Length - 2, 1); ViewState["SelectedContacts"] = null; hdrchkselected.Clear(); if (txtCampNameSearch.Text != string.Empty || txtCampDesSearch.Text != string.Empty || txtCreatedDate.Text != string.Empty) { SearchCriteria(0, string.Empty); } else { bindGrid(string.Empty, 0); } lblMainMsg.Text = "Successfully Edit Campaign(s) with ids: " + strbEditContacts.ToString(); hdnMeditselect.Value = "false"; } } }
/// <summary> /// This method will get row(s) from the database using the value of the field specified /// along with the details of the child table. /// </summary> /// /// <param name="pk" type="CampaignsPrimaryKey">Primary Key information based on which data is to be fetched.</param> /// /// <returns>object of class Campaigns</returns> /// /// <remarks> /// /// <RevisionHistory> /// Author Date Description /// DLGenerator 6/25/2012 02:05:58 PM Created function /// /// </RevisionHistory> /// /// </remarks> /// public static Campaign SelectOneWithCampaignMailingUsingCampaignMailId(CampaignPrimaryKey pk,string ConnectionString) { DatabaseHelper oDatabaseHelper = new DatabaseHelper(); bool ExecutionState = false; Campaign obj=null; // Pass the values of all key parameters to the stored procedure. System.Collections.Specialized.NameValueCollection nvc = pk.GetKeysAndValues(); foreach (string key in nvc.Keys) { oDatabaseHelper.AddParameter("@" + key,nvc[key] ); } // The parameter '@ErrorCode' will contain the status after execution of the stored procedure. oDatabaseHelper.AddParameter("@ErrorCode", -1, System.Data.ParameterDirection.Output); IDataReader dr=oDatabaseHelper.ExecuteReader("sp_Campaigns_SelectOneWithCampaignMailingUsingCampaignMailId", ref ExecutionState); if (dr.Read()) { obj = new Campaign(ConnectionString); PopulateObjectFromReader(obj,dr); dr.NextResult(); //Get the child records. obj.CampaignMailings = CampaignMailing.PopulateObjectsFromReader(dr, ConnectionString); } dr.Close(); oDatabaseHelper.Dispose(); return obj; }
protected void lBtnSave_Click(object sender, EventArgs e) { try { lbMsg.Text = string.Empty; Campaign = new Campaign(ConnectionString); Campaign.CampaignsName = txtCampName.Text; Campaign.CampaignsDesc = txtCampDescription.Text; Campaign.Active = true; Campaign.TotalCount = 0; DataTable dtCheck = CampaignBase.SelectByField("CampaignsName", txtCampName.Text.ToString(), ConnectionString); if (dtCheck.Rows.Count > 0) { if (dtCheck.Rows[0]["Active"].ToString() == "True") { lbMsg.ForeColor = Color.Red; lbMsg.Text = string.Format("Campaign: {0}, already exists. Please enter other name.", txtCampName.Text); CreateCampPE.Show(); } else { CampaignPrimaryKey pk = new CampaignPrimaryKey(Convert.ToInt64(dtCheck.Rows[0]["ID"].ToString())); CampaignBase campaignMail = CampaignBase.SelectOne(pk, ConnectionString); campaignMail.CampaignsDesc = string.Empty; campaignMail.CreatedDate = DateTime.Now; campaignMail.ModifiedDate = DateTime.Now; campaignMail.Active = true; lblMainMsg.Text = string.Format(campaignMail.Update() == true ? "Campaign {0} Created Successfully." : "Campaign {0} Created Failed.", txtCampName.Text); bindGrid(string.Empty, RGridCampMails.CurrentPageIndex); } } else { Campaign.CreatedDate = System.DateTime.Now; Campaign.ModifiedDate = System.DateTime.Now; lblMainMsg.Text = string.Format(Campaign.Insert() == true ? "Campaign {0} Created Successfully." : "Campaign {0} Created Failed.", txtCampName.Text); bindGrid(string.Empty, RGridCampMails.CurrentPageIndex); } } catch (Exception ex) { CreateCampPE.Show(); lbMsg.ForeColor = Color.Red; lbMsg.Text = "Error: " + ex.Message; } }
public void MailingRecords() { #region Mailing Demographics if (Request.QueryString["Page"].ToLower() == "yearsofgrade") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable yearOfGradRecs = objCampaign.getMailingRptByYearofGrade(ConnectionString, titleName, "GradYear_4Bytes", "Year", "ASC", 0, rowCount, out rowCount); yearOfGradRecs.Columns.Remove("RowRank"); if (yearOfGradRecs.Rows.Count != 0) { gvPrint.DataSource = yearOfGradRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Years of Grad"; } if (Request.QueryString["Page"].ToLower() == "major") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable academicRecs = objCampaign.getMailingRptByMajors(ConnectionString, titleName, "Selected_MajorCodeDescription", "Name", "ASC", 0, rowCount, out rowCount); academicRecs.Columns.Remove("RowRank"); if (academicRecs.Rows.Count != 0) { gvPrint.DataSource = academicRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Major"; } if (Request.QueryString["Page"].ToLower() == "sourcecode") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable sourceCodeRecs = objCampaign.getMailingRptBySourceCode(ConnectionString, titleName, "SourceCode", "SourceCode", "ASC", 0, rowCount, out rowCount); sourceCodeRecs.Columns.Remove("RowRank"); if (sourceCodeRecs.Rows.Count != 0) { gvPrint.DataSource = sourceCodeRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Source Code"; } if (Request.QueryString["Page"].ToLower() == "ethnicity") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable ethnicityRecs = objCampaign.getMailingRptByEthnicity(ConnectionString, titleName, "Ethnicity", "Ethnicity", "ASC", 0, rowCount, out rowCount); ethnicityRecs.Columns.Remove("RowRank"); if (ethnicityRecs.Rows.Count != 0) { gvPrint.DataSource = ethnicityRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Ethnicity"; } if (Request.QueryString["Page"].ToLower() == "state") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable stateRecs = objCampaign.getMailingRptByState(ConnectionString, titleName, "state", "ASC", 0, rowCount, out rowCount); stateRecs.Columns.Remove("RowRank"); if (stateRecs.Rows.Count != 0) { gvPrint.DataSource = stateRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "State"; } if (Request.QueryString["Page"].ToLower() == "engagment") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable EngagLinkUrls = objCampaign.getAllMailingLinkUrls(ConnectionString, titleName, "Clicks", "ASC"); if (EngagLinkUrls.Rows.Count != 0) { gvPrint.DataSource = EngagLinkUrls.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Engagement"; } if (Request.QueryString["Page"].ToLower() == "letterversion") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable letterVersionRecs = objCampaign.getMailingRptByLetterVersion(ConnectionString, titleName, "LetterVersion", "LetterVersion", "ASC", 0, rowCount, out rowCount); letterVersionRecs.Columns.Remove("RowRank"); if (letterVersionRecs.Rows.Count != 0) { gvPrint.DataSource = letterVersionRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Letter Version"; } if (Request.QueryString["Page"].ToLower() == "gender") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable genderRecs = objCampaign.getMailingRptByGender(ConnectionString, titleName, "Gender", "ASC", 0, rowCount, out rowCount); genderRecs.Columns.Remove("RowRank"); if (genderRecs.Rows.Count != 0) { gvPrint.DataSource = genderRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Gender"; } if (Request.QueryString["Page"].ToLower() == "highschoolname") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable schoolRecs = objCampaign.getMailingRptBySchool(ConnectionString, titleName, "HighSchoolName", "HighSchoolName", "ASC", 0, rowCount, out rowCount); schoolRecs.Columns.Remove("RowRank"); if (schoolRecs.Rows.Count != 0) { gvPrint.DataSource = schoolRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "High School Name"; } #endregion #region Mailing Details if (Request.QueryString["Page"].ToLower() == "totalcontacted") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; string MailingID = Request.QueryString["MailingId"] != null ? Request.QueryString["MailingId"] : string.Empty; DataTable ListSuccessfulDelivered = null; ListSuccessfulDelivered = ContactMaster.SelectSuccessfulDeliveredByCampId_PageWise(ConnectionString, MailingID, "ContactId", "desc", 0, rowCount, out rowCount); if (ListSuccessfulDelivered.Rows.Count != 0) { gvPrint.DataSource = ListSuccessfulDelivered.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Total Contacted"; } if (Request.QueryString["Page"].ToLower() == "uniqueemailopens") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; string MailingID = Request.QueryString["MailingId"] != null ? Request.QueryString["MailingId"] : string.Empty; DataTable ContactsMailOpened = null; ContactsMailOpened = ContactMaster.EmailOpendRecByCampId_PageWise(ConnectionString, MailingID, "ContactId", "desc", 0, rowCount, out rowCount, out TotalOpenCounts, out UniqueOpenCounts); if (ContactsMailOpened.Rows.Count != 0) { gvPrint.DataSource = ContactsMailOpened.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Unique Email Opens"; } if (Request.QueryString["Page"].ToLower() == "uniqueemailclicks") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; string MailingID = Request.QueryString["MailingId"] != null ? Request.QueryString["MailingId"] : string.Empty; DataTable ContactsMailClicked = null; ContactsMailClicked = ContactMaster.EmailClickedRecByCampId_PageWise(ConnectionString, MailingID, "ContactId", "desc", 0, rowCount, out rowCount, out TotalClickCounts, out UniqueClickCounts); if (ContactsMailClicked.Rows.Count != 0) { gvPrint.DataSource = ContactsMailClicked.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Unique Email Clicks"; } if (Request.QueryString["Page"].ToLower() == "uniqueformsubmits") { titleName = (Session["AdvMailingName"] != null) ? Session["AdvMailingName"].ToString() : string.Empty; string MailingID = Request.QueryString["MailingId"] != null ? Request.QueryString["MailingId"] : string.Empty; DataTable ContactsMailClicked = ContactMaster.EmailWheelockClickedRecByCampId_PageWise(ConnectionString, MailingID, "ContactId", "desc", 0, rowCount, out rowCount); // ContactsMailClicked.Columns.Remove("RowRank"); if (ContactsMailClicked.Rows.Count != 0) { gvPrint.DataSource = ContactsMailClicked.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Mailing:" + ' ' + titleName + ':' + ' ' + "Unique Form Submits"; } #endregion #region Campaign Demographics if (Request.QueryString["Page"].ToLower() == "camp_yearsofgrade") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable yearOfGradRecs = objCampaign.getCampaignRptByYearofGrade(ConnectionString, CampId, "GradYear_4Bytes", "Year", "desc", 0, rowCount, out rowCount); yearOfGradRecs.Columns.Remove("RowRank"); if (yearOfGradRecs.Rows.Count != 0) { gvPrint.DataSource = yearOfGradRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Years of Grad"; } if (Request.QueryString["Page"].ToLower() == "camp_major") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string campId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable academicRecs = objCampaign.getCampaignRptByMajors(ConnectionString, campId, "Selected_MajorCodeDescription", "Name", "desc", 0, rowCount, out rowCount); academicRecs.Columns.Remove("RowRank"); if (academicRecs.Rows.Count != 0) { gvPrint.DataSource = academicRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Major"; } if (Request.QueryString["Page"].ToLower() == "camp_sourcecode") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable sourceCodeRecs = objCampaign.getCampaignRptBySourceCode(ConnectionString, CampId, "SourceCode", "SourceCode", "desc", 0, rowCount, out rowCount); sourceCodeRecs.Columns.Remove("RowRank"); if (sourceCodeRecs.Rows.Count != 0) { gvPrint.DataSource = sourceCodeRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Source Code"; } if (Request.QueryString["Page"].ToLower() == "camp_ethnicity") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable ethnicityRecs = objCampaign.getCampaignRptByEthnicity(ConnectionString, CampId, "Ethnicity", "Ethnicity", "desc", 0, rowCount, out rowCount); ethnicityRecs.Columns.Remove("RowRank"); if (ethnicityRecs.Rows.Count != 0) { gvPrint.DataSource = ethnicityRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Ethnicity"; } if (Request.QueryString["Page"].ToLower() == "camp_state") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable stateRecs = objCampaign.getCampaignRptByState(ConnectionString, CampId, "state", "desc", 0, rowCount, out rowCount); stateRecs.Columns.Remove("RowRank"); if (stateRecs.Rows.Count != 0) { gvPrint.DataSource = stateRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "State"; } if (Request.QueryString["Page"].ToLower() == "camp_engagment") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable EngagLinkUrls = objCampaign.getAllMailingLinkUrlsByCampaign(ConnectionString, CampId, "Clicks", "desc"); if (EngagLinkUrls.Rows.Count != 0) { gvPrint.DataSource = EngagLinkUrls.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Engagement"; } if (Request.QueryString["Page"].ToLower() == "camp_letterversion") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable letterVersionRecs = objCampaign.getCampaignRptByLetterVersion(ConnectionString, CampId, "LetterVersion", "LetterVersion", "desc", 0, rowCount, out rowCount); letterVersionRecs.Columns.Remove("RowRank"); if (letterVersionRecs.Rows.Count != 0) { gvPrint.DataSource = letterVersionRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Letter Version"; } if (Request.QueryString["Page"].ToLower() == "camp_gender") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable genderRecs = objCampaign.getCampaignRptByGender(ConnectionString, CampId, "Gender", "desc", 0, rowCount, out rowCount); genderRecs.Columns.Remove("RowRank"); if (genderRecs.Rows.Count != 0) { gvPrint.DataSource = genderRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "Gender"; } if (Request.QueryString["Page"].ToLower() == "camp_highschoolname") { titleName = (Session["AdvCampName"] != null) ? Session["AdvCampName"].ToString() : string.Empty; string CampId = (Session["AdvCampId"] != null) ? Session["AdvCampId"].ToString() : string.Empty; Campaign objCampaign = new Campaign(ConnectionString); DataTable schoolRecs = objCampaign.getCampaignRptBySchool(ConnectionString, CampId, "HighSchoolName", "HighSchoolName", "desc", 0, rowCount, out rowCount); schoolRecs.Columns.Remove("RowRank"); if (schoolRecs.Rows.Count != 0) { gvPrint.DataSource = schoolRecs.DefaultView; gvPrint.DataBind(); } else ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Success", "alert('No Records to Print.')", true); lblTitle.Text = "Campaign:" + ' ' + titleName + ':' + ' ' + "High School Name"; } #endregion }
public void bindEngagmentRecs(string campId, int pageIndex, string fillflag) { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); //Clicks DataTable EngagLinkUrls = objCampaign.getAllMailingLinkUrlsByCampaign(ConnectionString, campId, GridSortExpression, sortdir); EngagLinkUrlsCount = EngagLinkUrls.Rows.Count; rgdClicksReport.DataSource = EngagLinkUrls; rgdClicksReport.DataBind(); GridPrevSortExpression = GridSortExpression; }