private void SearchByParams(string APageIndex) { btnStampaDistinta.Visible = false; ddlCartellaSposta.Visible = false; pnlSposta.Visible = btnSposta.Visible = false; btnUnLetta.Visible = false; btnLetta.Visible = false; HideMail(null, null); Dictionary <MailTypeSearch, string> idx = new Dictionary <MailTypeSearch, string>(); idx = getDictionaryChoice(); if (ddlManagedAccounts.SelectedItem.Text != string.Empty && ddlCartella.SelectedValue != string.Empty && rblIOBox.SelectedValue != string.Empty && rblTipoFolder.SelectedValue != string.Empty) { MailLocalService mailLocalService = new MailLocalService(); ResultList <MailHeaderExtended> result = mailLocalService.GetMailsGridByParams(ddlManagedAccounts.SelectedItem.Text, ddlCartella.SelectedValue, rblIOBox.SelectedValue, rblTipoFolder.SelectedValue, idx, 1, 5); gridBox.DataSource = result.List; gridBox.DataBind(); if (result.List.Count > 0) { btnStampaDistinta.Visible = true; ddlCartellaSposta.Visible = true; btnSposta.Visible = true; if (rblIOBox.SelectedValue == "I") { if (ddlInboxStato.SelectedValue == "1") { btnLetta.Visible = false; btnUnLetta.Visible = true; } if (ddlInboxStato.SelectedValue == "0") { btnLetta.Visible = true; btnUnLetta.Visible = false; } else if (ddlInboxStato.SelectedValue != "1" && ddlInboxStato.SelectedValue != "0") { btnLetta.Visible = false; btnUnLetta.Visible = false; } } else { btnLetta.Visible = false; btnUnLetta.Visible = false; } gridBox.BottomPagerRow.Controls[0].Controls[1].Visible = true; gridBox.BottomPagerRow.Visible = true; int resPag = int.Parse(Properties.Settings.Default.ListaRisultatiPerPagina); ((Paging)gridBox.BottomPagerRow.Controls[0].Controls[1]).configureControl("1", resPag.ToString(), result.Totale.ToString()); } } else { (this.Page as BasePage).info.AddMessage("Selezionare tutti i campi obbligatori", Com.Delta.Messaging.MapperMessages.LivelloMessaggio.INFO); } }
protected void btnStampa_Click(object sender, EventArgs e) { Dictionary <MailTypeSearch, string> idx = new Dictionary <MailTypeSearch, string>(); MailLocalService mailLocalService = new MailLocalService(); idx = getDictionaryChoice(); ResultList <MailHeaderExtended> result = mailLocalService.GetMailsGridByParams(ddlManagedAccounts.SelectedItem.Text, ddlCartella.SelectedValue, rblIOBox.SelectedValue, rblTipoFolder.SelectedValue, idx, 1, 1000); byte[] b = Helpers.StampaEmailAttoITEXT(result.List.ToList(), ddlManagedAccounts.SelectedItem.Text, ddlCartella.SelectedItem.Text, dtInizio.DateString(), dtFine.DateString(), rblIOBox.SelectedValue, ddlManagedAccounts.SelectedValue); Response.ContentType = "application/pdf"; Response.AppendHeader("Content-Disposition", "attachment; filename=DistintaMail_" + ddlManagedAccounts.SelectedItem.Text + ".pdf"); Response.OutputStream.Write(b, 0, b.Length); Response.End(); }
protected void OnPagerIndexChanged(string sPaginaRichiesta, int pag) { MailLocalService mailLocalService = new MailLocalService(); int da = (pag * int.Parse(Properties.Settings.Default.ListaRisultatiPerPagina)) + 1; int per = int.Parse(Properties.Settings.Default.ListaRisultatiPerPagina); Dictionary <MailTypeSearch, string> idx = new Dictionary <MailTypeSearch, string>(); idx = getDictionaryChoice(); ResultList <MailHeaderExtended> result = mailLocalService.GetMailsGridByParams(ddlManagedAccounts.SelectedItem.Text, ddlCartella.SelectedValue, rblIOBox.SelectedValue, rblTipoFolder.SelectedValue, idx, da, per); gridBox.DataSource = result.List; gridBox.DataBind(); gridBox.BottomPagerRow.Visible = true; ((Paging)gridBox.BottomPagerRow.Controls[0].Controls[1]).configureControl((pag + 1).ToString(), Properties.Settings.Default.ListaRisultatiPerPagina.ToString(), result.Totale.ToString()); }