Пример #1
0
        private void EditSelectedItem()
        {
            if (listRecipients.SelectedItems.Count != 1)
            {
                return;
            }

            formInputDialog inputDialog = new formInputDialog();

            int id = Convert.ToInt32(listRecipients.SelectedItems[0].Tag);

            hMailServer.DistributionListRecipients recipients = representedObject.Recipients;
            hMailServer.DistributionListRecipient  recipient  = recipients.get_ItemByDBID(id);

            inputDialog.Title = "Address";
            inputDialog.Text  = "Enter email address";
            inputDialog.Value = recipient.RecipientAddress;

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                recipient.RecipientAddress = inputDialog.Value;
                recipient.Save();
            }

            Marshal.ReleaseComObject(recipients);
            Marshal.ReleaseComObject(recipient);

            ListRecipients();
        }
Пример #2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Alias name";
            inputDialog.Text  = "Enter domain alias name";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                // Add it
                string value = inputDialog.Value;

                hMailServer.DomainAliases domainAliases = _domain.DomainAliases;

                DomainAlias domainAlias = domainAliases.Add();
                domainAlias.AliasName = value;
                try
                {
                    domainAlias.Save();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, EnumStrings.hMailServerAdministrator);
                    return;
                }

                Marshal.ReleaseComObject(domainAliases);
                Marshal.ReleaseComObject(domainAlias);

                ListDomainAliases();
            }
        }
Пример #3
0
        private void buttonAddRecipient_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Address";
            inputDialog.Text  = "Enter email address";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                hMailServer.DistributionListRecipients recipients = representedObject.Recipients;
                hMailServer.DistributionListRecipient  recipient  = recipients.Add();

                recipient.RecipientAddress = inputDialog.Value;
                recipient.Save();

                Marshal.ReleaseComObject(recipients);
                Marshal.ReleaseComObject(recipient);
            }

            ListRecipients();
        }
Пример #4
0
        private void buttonAddRecipient_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Address";
            inputDialog.Text  = "Enter email address";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                hMailServer.RouteAddresses routeAddresses = _representedObject.Addresses;
                hMailServer.RouteAddress   routeAddress   = routeAddresses.Add();

                routeAddress.Address = inputDialog.Value;
                routeAddress.Save();

                Marshal.ReleaseComObject(routeAddress);
                Marshal.ReleaseComObject(routeAddresses);
            }

            ListRecipients();
        }
Пример #5
0
        private void EditSelectedName()
        {
            if (listAliases.SelectedItems.Count != 1)
            {
                return;
            }

            int           id            = Convert.ToInt32(listAliases.SelectedItems[0].Tag);
            DomainAliases domainAliases = _domain.DomainAliases;

            hMailServer.DomainAlias da = domainAliases.get_ItemByDBID(id);

            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Alias name";
            inputDialog.Text  = "Enter domain alias name";
            inputDialog.Value = da.AliasName;

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                // Add it
                string value = inputDialog.Value;
                da.AliasName = value;

                try
                {
                    da.Save();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(Strings.Localize(ex.Message), EnumStrings.hMailServerAdministrator, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                ListDomainAliases();
            }

            Marshal.ReleaseComObject(domainAliases);
            Marshal.ReleaseComObject(da);
        }
Пример #6
0
        private void EditSelectedItem()
        {
            if (listRecipients.SelectedItems.Count != 1)
                return;

            formInputDialog inputDialog = new formInputDialog();

            int id = Convert.ToInt32(listRecipients.SelectedItems[0].Tag);
            hMailServer.DistributionListRecipients recipients = representedObject.Recipients;
            hMailServer.DistributionListRecipient recipient = recipients.get_ItemByDBID(id);

            inputDialog.Title = "Address";
            inputDialog.Text = "Enter email address";
            inputDialog.Value = recipient.RecipientAddress;

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                recipient.RecipientAddress = inputDialog.Value;
                recipient.Save();
            }

            Marshal.ReleaseComObject(recipients);
            Marshal.ReleaseComObject(recipient);

            ListRecipients();
        }
Пример #7
0
        private void buttonAddRecipient_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Address";
            inputDialog.Text = "Enter email address";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                hMailServer.DistributionListRecipients recipients = representedObject.Recipients;
                hMailServer.DistributionListRecipient recipient = recipients.Add();

                recipient.RecipientAddress = inputDialog.Value;
                recipient.Save();

                Marshal.ReleaseComObject(recipients);
                Marshal.ReleaseComObject(recipient);
            }

            ListRecipients();
        }
Пример #8
0
        private void EditSelectedName()
        {
            if (listAliases.SelectedItems.Count != 1)
              return;

               int id = Convert.ToInt32(listAliases.SelectedItems[0].Tag);
               DomainAliases domainAliases = _domain.DomainAliases;
               hMailServer.DomainAlias da = domainAliases.get_ItemByDBID(id);

               formInputDialog inputDialog = new formInputDialog();
               inputDialog.Title = "Alias name";
               inputDialog.Text = "Enter domain alias name";
               inputDialog.Value = da.AliasName;

               if (inputDialog.ShowDialog() == DialogResult.OK)
               {
              // Add it
              string value = inputDialog.Value;
              da.AliasName = value;

              try
              {
                 da.Save();
              }
              catch (Exception ex)
              {
                  MessageBox.Show(Strings.Localize(ex.Message), EnumStrings.hMailServerAdministrator, MessageBoxButtons.OK, MessageBoxIcon.Error);
              }

              ListDomainAliases();

               }

               Marshal.ReleaseComObject(domainAliases);
               Marshal.ReleaseComObject(da);
        }
Пример #9
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();
            inputDialog.Title = "Alias name";
            inputDialog.Text = "Enter domain alias name";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {
                // Add it
                string value = inputDialog.Value;

                hMailServer.DomainAliases domainAliases = _domain.DomainAliases;

                DomainAlias domainAlias = domainAliases.Add();
                domainAlias.AliasName = value;
                try
                {
                    domainAlias.Save();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, EnumStrings.hMailServerAdministrator);
                    return;
                }

                Marshal.ReleaseComObject(domainAliases);
                Marshal.ReleaseComObject(domainAlias);

                ListDomainAliases();
            }
        }
Пример #10
0
        private void buttonAddRecipient_Click(object sender, EventArgs e)
        {
            formInputDialog inputDialog = new formInputDialog();

            inputDialog.Title = "Address";
            inputDialog.Text = "Enter email address";

            if (inputDialog.ShowDialog() == DialogResult.OK)
            {

                hMailServer.RouteAddresses routeAddresses = _representedObject.Addresses;
                hMailServer.RouteAddress routeAddress = routeAddresses.Add();

                routeAddress.Address = inputDialog.Value;
                routeAddress.Save();

                Marshal.ReleaseComObject(routeAddress);
                Marshal.ReleaseComObject(routeAddresses);
            }

            ListRecipients();
        }