Ejemplo n.º 1
0
 protected void RegistersBtnRegisterModify_Click(object sender, EventArgs e)
 {
     try
     {
         string email = (this.GrdRegisters.SelectedRow.FindControl("DdlEmailRegister") as DropDownList).SelectedValue;
         List <DocsPaWR.InfoCheckMailbox> listCheckMailbox = CheckMailboxManager.InfoCheckMailbox(new List <string>()
         {
             email
         });
         if ((from checkMailBox in listCheckMailbox where checkMailBox.Concluded.Equals("0") select checkMailBox).Count() > 0)
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "if (parent.fra_main) {parent.fra_main.ajaxDialogModal('WarningRegisterModifyPass', 'warning', '');} else {parent.ajaxDialogModal('WarningRegisterModifyPass', 'warning', '');}", true);
             return;
         }
         else
         {
             SelectedRegister.email = email;
             ScriptManager.RegisterStartupScript(this, this.GetType(), "viewPrintRegister", "ajaxModalPopupRegisterModify();", true);
         }
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Funzione per l'inizializzazione della pagina
        /// </summary>
        private void InitializeControls()
        {
            Response.Expires = -1;
            // Recupero anagrafica dei report
            try
            {
                this.ReportRegistry = CheckMailboxManager.GetReportRegistry(RequestPrintReport.ContextName);
                // DataBinding con la drop down list dei report
                this.DdlReportGenerator.DataSource = this.ReportRegistry;
                this.DdlReportGenerator.DataBind();
                this.ShowReportMetadata(this.ReportRegistry[0]);
                if (ReadOnlySubtitle)
                {
                    this.txtReportSubtitle.Enabled = false;
                }

                // visibilità GrdFields
                if (VisibleGrdFields != null)
                {
                    if (GrdFields != null && GrdFields.Rows.Count > 0)
                    {
                        this.GrdFields.Visible       = VisibleGrdFields;
                        this.lblFilterExport.Visible = VisibleGrdFields;
                    }
                    else
                    {
                        this.pnlFieldsSelection.Visible = false;
                    }
                }

                //Visibilità selezione formati export
                //PDF
                if (!ActiveExportFormatPDF)
                {
                    ddlExportFormat.Items.RemoveAt(0);
                }
                //EXCEL
                if (!ActiveExportFormatExcel)
                {
                    ddlExportFormat.Items.RemoveAt(1);
                }
                //ODS
                if (!ActiveExportFormatODS)
                {
                    ddlExportFormat.Items.RemoveAt(2);
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.parent.ajaxDialogModal('ErrorReportGeneratorExtractInfo', 'error', '');", true);
                return;
            }
        }
Ejemplo n.º 3
0
 protected void CheckMailboxReportClose_Click(object sender, EventArgs e)
 {
     try {
         CheckMailboxManager.RemoveReportMailbox(IdCheckMailbox);
         HttpContext.Current.Session.Remove("mailCheckResponse");
         ScriptManager.RegisterClientScriptBlock(this.UpPnlButtons, this.UpPnlButtons.GetType(), "closeAJM", "parent.closeAjaxModal('CheckMailboxReport','close');", true);
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return;
     }
 }
Ejemplo n.º 4
0
        protected void ReadRetValueFromPopup()
        {
            if (this.Request.Form["__EVENTTARGET"] != null && this.Request.Form["__EVENTTARGET"].Equals(PANEL_REGISTERS))
            {
                this.GrdRegisters.SelectedIndex = int.Parse(this.grid_rowindex.Value);
                HighlightSelectedRow();
                SelectedRegister = ListRegisters[this.GrdRegisters.SelectedIndex + this.GrdRegisters.PageIndex * this.GrdRegisters.PageSize];
                ButtonsManager();
                if ((GrdRegisters.SelectedRow.FindControl("DdlEmailRegister") as DropDownList).Enabled && this.RegistersBtnBox.Visible)
                {
                    UpdateStateMailbox(SELECTED_MAILBOX);
                }
                if ((GrdRegisters.SelectedRow.FindControl("idCheckMailbox") as HiddenField).Value != null)
                {
                    IdCheckMailbox = (GrdRegisters.SelectedRow.FindControl("idCheckMailbox") as HiddenField).Value;
                }
                return;
            }

            if (this.Request.Form["__EVENTTARGET"] != null && this.Request.Form["__EVENTTARGET"].Equals(UP_PANEL_BUTTONS))
            {
                if (this.Request.Form["__EVENTARGUMENT"] != null && (this.Request.Form["__EVENTARGUMENT"].Equals(CLOSE_CHECK_MAILBOX_REPORT)))
                {
                    CheckMailboxManager.RemoveReportMailbox(IdCheckMailbox);
                    DeletePropertyCheckMailboxReport();
                    ButtonsManager();
                    UpdateStateMailbox(ALL_MAILBOX);
                    this.panelRegisters.Update();
                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setReturnValue", "SetRetValue('CheckMailboxReport','')", true);
                    return;
                }
            }

            if (!string.IsNullOrEmpty(HiddenVerifyBox.Value))
            {
                CheckIstitutionalMailbox();
                this.HiddenVerifyBox.Value = string.Empty;
            }

            if (!string.IsNullOrEmpty(this.RegisterModify.ReturnValue))
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setReturnValue", "SetRetValue('RegisterModify','')", true);
                return;
            }
        }
Ejemplo n.º 5
0
        protected void ReportGeneratorExport_Click(object sender, EventArgs e)
        {
            try {
                // Impostazione delle proprietà del report da produrre
                RequestPrintReport.ReportKey       = this.DdlReportGenerator.SelectedValue;
                RequestPrintReport.ReportType      = (ReportTypeEnum)Enum.Parse(typeof(ReportTypeEnum), this.ddlExportFormat.SelectedValue, true);
                RequestPrintReport.SubTitle        = String.IsNullOrEmpty(this.txtReportSubtitle.Text) ? this.tbwSubtitle.WatermarkText : this.txtReportSubtitle.Text;
                RequestPrintReport.Title           = String.IsNullOrEmpty(this.txtReportTitle.Text) ? this.tbwTitle.WatermarkText : this.txtReportTitle.Text;
                RequestPrintReport.ColumnsToExport = this.ReportRegistry.Where(r => r.ReportKey == this.DdlReportGenerator.SelectedValue).First().ExportableFields;

                FileDocumento temp = null;

                try
                {
                    temp = CheckMailboxManager.GenerateReport(RequestPrintReport);
                }
                catch
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.parent.ajaxDialogModal('ErrorReportGenerator', 'error', '');", true);
                    return;
                }

                if (temp != null)
                {
                    FileDocPrintReport = temp;

                    this.reportContent.Attributes["src"] = "../Popup/ReportContent.aspx";
                    this.upPanelFrame.Update();
                }
            }
            catch (System.Exception ex)
            {
                UIManager.AdministrationManager.DiagnosticError(ex);
                return;
            }
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try {
         if (!IsPostBack)
         {
             InitializeLanguage();
             //if (MailCheckResponse == null)
             MailCheckResponse = CheckMailboxManager.InfoReportMailbox(IdCheckMailbox);
             MailCheckResponse.MailProcessedList = (from resp in MailCheckResponse.MailProcessedList orderby resp.Date descending select resp).ToArray();
             FetchMailAccountCheckInfo();
             GrdMails_Bind();
         }
         else
         {
             Refresh();
             ReadRetValueFromPopup();
         }
     }
     catch (System.Exception ex)
     {
         UIManager.AdministrationManager.DiagnosticError(ex);
         return;
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Aggiorna lo stato di avanzamento per la casella
        /// </summary>
        private void UpdateStateMailbox(string typeUpdate)
        {
            //Tre possibili aggiornamenti:
            //   -da bottone(si aggiornano tutte le caselle, attualmente selezionate, per tutti i registri)
            //   -selezionado il registro(si va ad aggiornare la casella selezionata nel momento in cui si seleziona un registro)
            //   -selezionando una casella nel dropDownList(si va ad aggiornare lo stato per la casella appena selezionata)
            List <string> listEmails = new List <string>();
            List <DocsPaWR.InfoCheckMailbox> listCheckMailbox;
            string mail = string.Empty;

            switch (typeUpdate)
            {
            case "allMailbox":
                foreach (GridViewRow grd in this.GrdRegisters.Rows)
                {
                    if ((grd.FindControl("DdlEmailRegister") as DropDownList).Enabled)
                    {
                        grd.FindControl("containerVerifyEmail").Visible = false;
                        mail = (grd.FindControl("DdlEmailRegister") as DropDownList).SelectedValue;
                        listEmails.Add(mail);
                    }
                }
                listCheckMailbox = CheckMailboxManager.InfoCheckMailbox(listEmails);
                if ((from checkMailBox in listCheckMailbox where checkMailBox.UserID.Equals(UserManager.GetUserInSession().systemId) && checkMailBox.RoleID.Equals(RoleManager.GetRoleInSession().systemId) select checkMailBox).Count() > 0)
                {
                    foreach (GridViewRow grd in this.GrdRegisters.Rows)
                    {
                        if ((grd.FindControl("DdlEmailRegister") as DropDownList).Enabled)
                        {
                            UpdateStateMailBoxManager(grd, listCheckMailbox);
                        }
                    }
                }

                break;

            case "selectedMailbox":
            {
                mail = (this.GrdRegisters.SelectedRow.FindControl("DdlEmailRegister") as DropDownList).SelectedValue;
                listEmails.Add(mail);

                listCheckMailbox = CheckMailboxManager.InfoCheckMailbox(listEmails);

                if ((from checkMailBox in listCheckMailbox where checkMailBox.UserID.Equals(UserManager.GetUserInSession().systemId) && checkMailBox.RoleID.Equals(RoleManager.GetRoleInSession().systemId) select checkMailBox).Count() > 0)
                {
                    UpdateStateMailBoxManager(this.GrdRegisters.SelectedRow, listCheckMailbox);
                }
                else
                {
                    this.GrdRegisters.SelectedRow.FindControl("containerVerifyEmail").Visible = false;
                }
            }
            break;
            }
            foreach (GridViewRow grd in this.GrdRegisters.Rows)
            {
                if (string.IsNullOrEmpty((grd.FindControl("checkMailbox") as HiddenField).Value))
                {
                    this.RegistersBtnUpdateStateBox.Enabled = false;
                }
                else
                {
                    this.RegistersBtnUpdateStateBox.Enabled = true;
                    break;
                }
            }

            //if (!this.RegistersBtnUpdateStateBox.Enabled)
            //    this.TimerUpdateMailbox.Enabled = false;
            //else
            //    if(!this.TimerUpdateMailbox.Enabled)
            //        this.TimerUpdateMailbox.Enabled = true;
        }
Ejemplo n.º 8
0
        private int creaGrigioDaReport(bool trasmDoc)
        {
            string     language = UIManager.UserManager.GetUserLanguage();
            InfoUtente userInfo = UserManager.GetInfoUser();
            Ruolo      ruolo    = RoleManager.GetRoleInSession();

            PrintReportRequestDataset request =
                new PrintReportRequestDataset()
            {
                ContextName   = "CasellaIstituzionale",
                ReportType    = ReportTypeEnum.PDF,
                ReportKey     = "RicercaCasellaIstituzionale",
                Title         = Utils.Languages.GetLabelFromCode("CheckMailboxReportLblIstitutionalBox", language),
                SubTitle      = String.Format(Utils.Languages.GetLabelFromCode("ReportGeneratorTbwSubtitle", language), MailCheckResponse.DtaConcluded.ToShortDateString(), MailCheckResponse.DtaConcluded.ToShortTimeString()),
                SearchFilters = null,
                UserInfo      = userInfo,
                InputDataset  = reportDataSetDocGrigio
            };

            RequestPrintReport  = request;
            this.ReportRegistry = CheckMailboxManager.GetReportRegistry(RequestPrintReport.ContextName);
            RequestPrintReport.ColumnsToExport = this.ReportRegistry.Where(r => r.ReportKey == request.ReportKey).First().ExportableFields;

            FileDocumento fd = CheckMailboxManager.GenerateReport(request);

            int retValue = 0;

            try
            {
                DocsPaWR.SchedaDocumento scheda = new SchedaDocumento();
                DocsPaWR.Oggetto         ogg    = new Oggetto();
                DocsPaWR.FileRequest     fr     = null;
                //Report Casella Istituzional del RF: codice/descrizione

                ogg.descrizione  = String.Format("Report Casella Istituzionale {0} del {1} alle {2}", this.txtRegistro.Text, MailCheckResponse.DtaConcluded.ToShortDateString(), MailCheckResponse.DtaConcluded.ToShortTimeString());
                scheda.oggetto   = ogg;
                scheda.personale = "0";
                scheda.privato   = "0";
                scheda.userId    = UserManager.GetInfoUser().userId;
                scheda.typeId    = "LETTERA";
                scheda.tipoProto = "G";
                scheda.appId     = "ACROBAT";
                scheda.idPeople  = UserManager.GetInfoUser().idPeople;
                scheda           = CheckMailboxManager.DocumentoAddDocGrigia(scheda, UserManager.GetInfoUser(), RoleManager.GetRoleInSession());
                fr           = (FileRequest)scheda.documenti[0];
                fr.docNumber = scheda.docNumber;
                fr           = CheckMailboxManager.DocumentoPutFile(fr, fd, UserManager.GetInfoUser());
                if (fr != null)
                {
                    retValue = 1;
                }
                //disabilito il pulsante di creazione doc grigio
                this.CheckMailboxReportCreateDoc.Enabled = false;
                if (trasmDoc)
                {
                    CreateAndTrasmDoc(scheda, userInfo, ruolo);
                }
            }
            catch (Exception ex) { retValue = 0; }
            return(retValue);
        }