Exemplo n.º 1
0
        private void FillGrid()
        {
            EmailAddresses.RefreshCache();
            _listEmailAddresses = EmailAddresses.GetDeepCopy();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g(this, "User Name"), 240);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Sender Address"), 270);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Default"), 50, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Notify"), 0, HorizontalAlignment.Center);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < _listEmailAddresses.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(_listEmailAddresses[i].EmailUsername);
                row.Cells.Add(_listEmailAddresses[i].SenderAddress);
                row.Cells.Add((_listEmailAddresses[i].EmailAddressNum == PrefC.GetLong(PrefName.EmailDefaultAddressNum))?"X":"");
                row.Cells.Add((_listEmailAddresses[i].EmailAddressNum == PrefC.GetLong(PrefName.EmailNotifyAddressNum))?"X":"");
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemplo n.º 2
0
        private void FillGrid()
        {
            EmailAddresses.RefreshCache();
            _listEmailAddresses = EmailAddresses.GetDeepCopy();
            //Add user specific email addresses to the list
            List <Userod> listUsers = new List <Userod>();

            if (Security.IsAuthorized(Permissions.SecurityAdmin, true) && !IsSelectionMode)
            {
                listUsers.AddRange(Userods.GetUsers());                //If authorized, get all non-hidden users.
            }
            else
            {
                listUsers.Add(Security.CurUser);                //Otherwise, just this user.
            }
            foreach (Userod user in listUsers)
            {
                EmailAddress userAddress = EmailAddresses.GetForUser(user.UserNum);
                if (userAddress != null)
                {
                    _listEmailAddresses.Insert(0, userAddress);
                }
            }
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            GridColumn col;

            col = new GridColumn(Lan.g(this, "User Name"), 240);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Sender Address"), 270);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "User"), 135);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Default"), 50, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            col = new GridColumn(Lan.g(this, "Notify"), 0, HorizontalAlignment.Center);
            gridMain.ListGridColumns.Add(col);
            gridMain.ListGridRows.Clear();
            GridRow row;

            foreach (EmailAddress emailAddress in _listEmailAddresses)
            {
                row = new GridRow();
                row.Cells.Add(emailAddress.EmailUsername);
                row.Cells.Add(emailAddress.SenderAddress);
                row.Cells.Add(Userods.GetName(emailAddress.UserNum));
                row.Cells.Add((emailAddress.EmailAddressNum == PrefC.GetLong(PrefName.EmailDefaultAddressNum))?"X":"");
                row.Cells.Add((emailAddress.EmailAddressNum == PrefC.GetLong(PrefName.EmailNotifyAddressNum))?"X":"");
                row.Tag = emailAddress;
                gridMain.ListGridRows.Add(row);
            }
            gridMain.EndUpdate();
        }
Exemplo n.º 3
0
        ///<summary>Inserts the new email address and returns it.</summary>
        public static EmailAddress CreateEmailAddress(string senderAddress = "", string emailUserName = "")
        {
            EmailAddress email = new EmailAddress();

            email.SenderAddress = senderAddress;
            if (senderAddress == "")
            {
                email.SenderAddress = "Email" + MiscUtils.CreateRandomAlphaNumericString(4);
            }
            email.EmailUsername = emailUserName;
            EmailAddresses.Insert(email);
            EmailAddresses.RefreshCache();
            return(email);
        }
Exemplo n.º 4
0
        private void FillGrid()
        {
            EmailAddresses.RefreshCache();
            gridMain.BeginUpdate();
            gridMain.Columns.Clear();
            ODGridColumn col;

            col = new ODGridColumn(Lan.g(this, "User Name"), 300);
            gridMain.Columns.Add(col);
            col = new ODGridColumn(Lan.g(this, "Default"), 20);
            gridMain.Columns.Add(col);
            gridMain.Rows.Clear();
            ODGridRow row;

            for (int i = 0; i < EmailAddresses.Listt.Count; i++)
            {
                row = new ODGridRow();
                row.Cells.Add(EmailAddresses.Listt[i].EmailUsername);
                row.Cells.Add((EmailAddresses.Listt[i].EmailAddressNum == PrefC.GetLong(PrefName.EmailDefaultAddressNum))?"X":"");
                gridMain.Rows.Add(row);
            }
            gridMain.EndUpdate();
        }