Esempio n. 1
0
        private void UpdateEmails()
        {
            EmailAdapter ea = new EmailAdapter();

            lstEmails.Title   = LangResources.CurLang.Emails;
            lstEmails.Columns = new List <ListColumn>()
            {
                new ListColumn(LangResources.CurLang.Unread, 35),
                new ListColumn(LangResources.CurLang.Date, 125),
                new ListColumn(LangResources.CurLang.Subject, 390)
            };

            List <ListRow> rows   = new List <ListRow>();
            List <Email>   emails = ea.GetEmails(SetupData.ManagerData.UniqueID);

            foreach (Email e in emails)
            {
                EmailViewable ev = ea.ConvertEmailToViewable(e);

                rows.Add(new ListRow(e.UniqueID, new List <object>()
                {
                    (ev.Read ? null : GraphicUtils.StarRating(1)),
                    ev.Date.ToString(LangResources.CurLang.DateFormat),
                    ev.Subject
                }));
            }

            lstEmails.Rows               = rows;
            lstEmails.SelectionMode      = SelectMode.HighlightAndCallback;
            lstEmails.Callback_ItemClick = ShowEmail;
        }
Esempio n. 2
0
        private void ShowEmail()
        {
            int id = lstEmails.SelectedID;

            if (id > -1)
            {
                EmailAdapter ea = new EmailAdapter();

                EmailViewable ev = ea.ConvertEmailToViewable(ea.GetEmail(SetupData.ManagerData.UniqueID, id));

                lblFromDetail.Text    = ev.From;
                lblDateDetail.Text    = ev.Date.ToString(LangResources.CurLang.DateFormat);
                lblSubjectDetail.Text = ev.Subject;
                lblEmail.Text         = ev.Body;

                ea.MarkEmailAsRead(SetupData.ManagerData.UniqueID, ev.UniqueID, true);
            }
        }