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, string AssignCampId) { try { string sortdir = (fillflag == "sort" ? GetSortDirection() : GridViewSortDirection); Campaign objCampaign = new Campaign(ConnectionString); DataTable campaignJobs = objCampaign.getMailingCampaignsCountWithFile(ConnectionString, AssignCampId, GridSortExpression, sortdir, pageIndex, 10, out rowCount); RGridCampMails.CurrentPageIndex = pageIndex; RGridCampMails.VirtualItemCount = rowCount; RGridCampMails.DataSource = campaignJobs; RGridCampMails.DataBind(); GridPrevSortExpression = GridSortExpression; } catch (Exception ex) { throw ex; } }
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(); } } } } }
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(); } } }