Exemplo n.º 1
0
 protected void MailResearch_Mail(RicercaMail.MailSelectedEventArgs e)
 {
     if (!e.UId.IsNullOrWhiteSpace())
     {
         if (!(WebMailClientManager.CurrentMailExist() && e.UId.Trim() == WebMailClientManager.CurrentMailGet().Uid))
         {
             MailServerConfigFacade mailserveconfigfacade = MailServerConfigFacade.GetInstance();
             MailUser account = mailserveconfigfacade.GetUserByUserId(decimal.Parse(e.CurrentAccount));
             account.Validated = true;
             WebMailClientManager.SetAccount(account);
             int idim = 0;
             WebMailClientManager.CurrentFolderSet(e.CurrentFolder);
             WebMailClientManager.ParentFolderSet(e.ParentFolder);
             if (e.Dimension != string.Empty)
             {
                 idim = int.Parse(e.Dimension);
             }
             if (idim < int.Parse(ConfigurationManager.AppSettings["MaxMemoryDimensionForMailViewer"]))
             {
                 MailViewer1.Initialize(e.UId, e.CurrRating, e.CurrentFolder, e.ParentFolder);
                 pnlMail.Update();
             }
             else
             {
                 Message msg = new Message();
                 msg.Uid  = e.UId;
                 msg.Size = idim;
                 WebMailClientManager.CurrentMailSet(msg);
                 MailViewer1.Initialize(e.UId, e.CurrRating, WebMailClientManager.CurrentFolderGet(), WebMailClientManager.ParentFolderGet());
                 pnlMail.Update();
             }
         }
     }
 }
Exemplo n.º 2
0
 protected void Inbox1_OnRowSelected(object sender, InBox.RowSelectedEventArgs e)
 {
     if (!WebMailClientManager.AccountIsValid())
     {
         AccountInvalidated();
     }
     if (!e.UId.IsNullOrWhiteSpace())
     {
         if (!(WebMailClientManager.CurrentMailExist() && e.UId.Trim() == WebMailClientManager.CurrentMailGet().Uid))
         {
             // string folder = e.CurrentFolder.Parse(0);
             //  MailFolder mailFolder = (MailFolder)folder;
             WebMailClientManager.CurrentFolderSet(e.CurrentFolder);
             WebMailClientManager.ParentFolderSet(e.ParentFolder);
             if (e.Dimension < int.Parse(ConfigurationManager.AppSettings["MaxMemoryDimensionForMailViewer"]))
             {
                 MailViewer1.Initialize(e.UId, e.CurrentRating, e.CurrentFolder, e.ParentFolder);
             }
             else
             {
                 Message msg = new Message();
                 MailViewer1.hfUIDMailValue = msg.Uid = e.UId;
                 msg.Size = e.Dimension;
                 WebMailClientManager.CurrentMailSet(msg);
                 MailViewer1.Initialize(e.UId, e.CurrentRating, WebMailClientManager.CurrentFolderGet(), WebMailClientManager.ParentFolderGet());
                 pnlMail.Update();
             }
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Metodo per il caricamento del messaggio originale
        /// </summary>
        /// <returns></returns>
        private Message GetOriginalMessage()
        {
            Message msg = WebMailClientManager.CurrentMailGet();

            if (msg == null)
            {
                return(null);
            }

            if (!String.IsNullOrEmpty(msg.HeaderFields["x-trasporto"]) &&
                String.Equals(msg.HeaderFields["x-trasporto"], "posta-certificata", StringComparison.InvariantCultureIgnoreCase))
            {
                int id = msg.Id;
                msg    = msg.SubMessages[0];
                msg.Id = id;
            }
            return(msg);
        }
Exemplo n.º 4
0
        // Testare bene todo modificare mailmove
        protected void MailViewer1_OnRequireAction(object sender, MailActionEventArgs action, string parentFolder)
        {
            switch (action.Action)
            {
            case MailActions.ACQUIRE:
                if (WebMailClientManager.CurrentMailExist() && WebMailClientManager.AccountIsValid())
                {
                    MailUser muser = WebMailClientManager.getAccount();
                    Message  msg   = WebMailClientManager.CurrentMailGet();
                    while (msg.Container != null)
                    {
                        msg = msg.Container;
                        WebMailClientManager.CurrentMailRemove();
                    }
                    if (!WebMailClientManager.CurrentMailExist())
                    {
                        WebMailClientManager.CurrentMailSet(msg);
                    }
                    if (!String.IsNullOrEmpty(msg.HeaderFields["x-trasporto"]) &&
                        msg.HeaderFields["x-trasporto"].Equals("posta-certificata", StringComparison.InvariantCultureIgnoreCase))
                    {
                        string uid = msg.Uid;
                        int    id  = msg.Id;
                        msg     = msg.SubMessages[0];
                        msg.Uid = uid;
                        msg.Id  = id;
                    }
                    try
                    {
                        //TODO:ACQUISIOZNE MAIL INIT BEAKPONT - ALBERTO
                        if (msg.Uid == null)
                        {
                            msg.Uid = MailViewer1.hfUIDMailValue;
                        }
                        //Richiesta req = FaxPec.ServiceContracts.ServiceLocator.GetServiceFactory().RichiestaService.ProcessMail(muser, msg, parentFolder);
                        //if (req != null)
                        //{
                        //    List<string> uids = new List<string>();
                        //    uids.Add(msg.Uid);
                        //    string utente = Com.Delta.Anag.Security.MySecurityProvider.CurrentPrincipalName;
                        //    ServiceLocator.GetServiceFactory().getMailServerFacade(muser).MailMove(uids, MailStatus.LETTA, "1", utente, parentFolder);
                        //    FaxPec.Caching.Session.SessionManager<Richiesta>.set(FaxPec.Caching.Session.SessionKeys.FAXPEC_RICHIESTA, req);
                        //}
                    }
                    catch (ManagedException bex)
                    {
                        if (bex.GetType() != typeof(ManagedException))
                        {
                            ManagedException mEx = new ManagedException(bex.Message, "ERR_G043", string.Empty, string.Empty, bex);
                            ErrorLogInfo     er  = new ErrorLogInfo(mEx);
                            log.Error(er);
                        }
                        ((BasePage)Page).info.AddMessage(bex, Com.Delta.Messaging.MapperMessages.LivelloMessaggio.ERROR);
                        return;
                    }
                    //  Response.Redirect("~/pages/Istruz/IstruzioneRichiesta.aspx?m=m");
                }
                break;

            case MailActions.FORWARD:
            case MailActions.REPLY_TO:
            case MailActions.RE_SEND:
                ucSendMail.Visible = true;
                if (WebMailClientManager.AccountIsValid())
                {
                    ucSendMail.LoginVisibile(false);
                }
                ucSendMail.Initialize(action.Action);
                break;

            case MailActions.SEND:
                throw new NotImplementedException();
            }
        }