Example #1
0
 private void OnEditAccountClick(object sender, EventArgs e)
 {
     try
     {
         AccountNode un = this.SelectedNode as AccountNode;
         if (un != null)
         {
             GroupNode gn = un.Parent as GroupNode;
             if (gn != null)
             {
                 DlgAddAccount adu = new DlgAddAccount();
                 adu.GroupName = gn.GroupName;
                 adu.OldEmail  = un.Account.Email;
                 adu.Account   = un.Account;
                 if (adu.ShowDialog() == DialogResult.OK)
                 {
                     un.Text    = adu.Account.UserName;
                     un.Account = adu.Account;
                     OnAfterSelect(null, null);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }
Example #2
0
 private void OnAddAccountClick(object sender, EventArgs e)
 {
     try
     {
         GroupNode gn = this.SelectedNode as GroupNode;
         if (gn != null)
         {
             DlgAddAccount adu = new DlgAddAccount();
             adu.GroupName = gn.GroupName;
             if (adu.ShowDialog() == DialogResult.OK)
             {
                 AccountNode un = new AccountNode(adu.Account);
                 gn.Nodes.Add(un);
                 gn.Text = gn.GroupName + "(" + gn.Nodes.Count + ")";
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }
Example #3
0
 private void OnEditAccountClick(object sender, EventArgs e)
 {
     try
     {
         AccountNode un = this.SelectedNode as AccountNode;
         if (un != null)
         {                    
             GroupNode gn = un.Parent as GroupNode;
             if (gn != null)
             {
                 DlgAddAccount adu = new DlgAddAccount();
                 adu.GroupName = gn.GroupName;
                 adu.OldEmail = un.Account.Email;
                 adu.Account = un.Account;
                 if (adu.ShowDialog() == DialogResult.OK)
                 {
                     un.Text = adu.Account.UserName;
                     un.Account = adu.Account;
                     OnAfterSelect(null, null);
                 }                        
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }
Example #4
0
 private void OnAddAccountClick(object sender, EventArgs e)
 {
     try
     {
         GroupNode gn = this.SelectedNode as GroupNode;
         if (gn != null)
         {
             DlgAddAccount adu = new DlgAddAccount();
             adu.GroupName = gn.GroupName;
             if (adu.ShowDialog() == DialogResult.OK)
             {
                 AccountNode un = new AccountNode(adu.Account);
                 gn.Nodes.Add(un);
                 gn.Text = gn.GroupName + "(" + gn.Nodes.Count + ")";
             }
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.ShowMessageBox(TreeConstants.EXCEPTION_MODULE, ex);
     }
 }