Пример #1
0
 private void btnEditGroup_Click(object sender, EventArgs e)
 {
     try
     {
         Cursor.Current       = Cursors.WaitCursor;
         ListPrivateGroupSend = new List <string>();
         List <String> ListPrivateGroupMembers = new List <string>();
         int           j = 0;
         for (int i = 0; i < ListViewItemPrivateGroup.Length; i++)
         {
             if (ListViewItemPrivateGroup[i].Checked)
             {
                 ListPrivateGroupSend.Add(ListViewItemPrivateGroup[i].Text);
                 j++;
             }
         }
         if (j == 0)
         {
             Cursor.Current = Cursors.Default;
             MessageBox.Show(SettingList["MsgBoxEmptyGroupEdit"], SettingList["MsgBoxCaptionWarning"], MessageBoxButtons.OK);
             return;
         }
         if (j > 1)
         {
             Cursor.Current = Cursors.Default;
             MessageBox.Show(SettingList["MsgBoxOneGroupEdit"], SettingList["MsgBoxCaptionWarning"], MessageBoxButtons.OK);
             return;
         }
         String groupName    = ListPrivateGroupSend[0];
         String groupMembers = "";
         ListPrivateGroupMembers = ServerObj.GetPrivateGroupMembers(userNameCurrent, ListPrivateGroupSend);
         foreach (String tmp in ListPrivateGroupMembers)
         {
             groupMembers = groupMembers + " " + tmp + ";";
         }
         GroupForm groupForm = new GroupForm(SettingList, ServerObj, groupName.Trim(), groupMembers.Trim(), userNameCurrent, "edit");
         if (groupForm.ShowDialog() == DialogResult.OK)
         {
             Cursor.Current   = Cursors.WaitCursor;
             ListPrivateGroup = ServerObj.GetPrivateGroups(userNameCurrent);
         }
         listViewPrivateGroup.Items.Clear();
         LoadListViewPrivateGroup();
         Cursor.Current = Cursors.Default;
     }
     catch (Exception ex)
     {
         Cursor.Current = Cursors.Default;
         MessageBox.Show(SettingList["MsgBoxErrListSendTo"] + " " + ex.Message, SettingList["MsgBoxCaptionError"], MessageBoxButtons.OK);
     }
 }
Пример #2
0
 private void btnAddGroup_Click(object sender, EventArgs e)
 {
     try
     {
         GroupForm groupForm = new GroupForm(SettingList, ServerObj, null, null, userNameCurrent, "add");
         if (groupForm.ShowDialog() == DialogResult.OK)
         {
             Cursor.Current   = Cursors.WaitCursor;
             ListPrivateGroup = ServerObj.GetPrivateGroups(userNameCurrent);
         }
         listViewPrivateGroup.Items.Clear();
         LoadListViewPrivateGroup();
         Cursor.Current = Cursors.Default;
     }
     catch (Exception ex)
     {
         Cursor.Current = Cursors.Default;
         MessageBox.Show(SettingList["MsgBoxErrListSendTo"] + " " + ex.Message, SettingList["MsgBoxCaptionError"], MessageBoxButtons.OK);
     }
 }