Exemplo n.º 1
0
 private void btn_add_Click(object sender, EventArgs e)
 {
     if (allowAction)
     {
         if (uc_addressBook.AllContactCount < ContactDB.MAX_CONTACT)
         {
             AddEditContactForm frm = new AddEditContactForm(this, -1);
             frm.ShowDialog();
         }
         else
         {
             string msg = DownloadStatusUtility.StatusToString(DownloadStatus.MAXIMUM_CONTACT_EXEED);
             MessageBox.Show(msg);
         }
     }
 }
Exemplo n.º 2
0
 private void btn_edit_Click(object sender, EventArgs e)
 {
     if (allowAction)
     {
         ListViewItem item;
         int count = listview_contacts.Items.Count;
         for (int i = 0; i < count; i++)
         {
             item = listview_contacts.Items[i];
             if (item.Checked)
             {
                 int idx = (int)item.Tag;
                 int id = listContact[idx].Id;
                 AddEditContactForm frm = new AddEditContactForm(this, id);
                 frm.ShowDialog();
                 return;
             }
         }
     }
 }
Exemplo n.º 3
0
 private void combbox_add_SelectedIndexChanged(object sender, EventArgs e)
 {
     switch (combbox_add.SelectedIndex)
     {
         case 0: // manually
             if (listAllContact.Count() < printer.MaxAccount)
             {
                 AddEditContactForm frm = new AddEditContactForm(this, null, listGroupName);
                 frm.ShowDialog();
             }
             else
             {
                 string msg = DownloadStatusUtility.StatusToString(DownloadStatus.MAXIMUM_CONTACT_EXEED);
                 MessageBox.Show(msg);
             }
             break;
         case 1: // local
             if (listAllContact.Count() < printer.MaxAccount)
             {
                 List<int> notInList = GetContactDBIDList();
                 SelectLocalContactForm frm = new SelectLocalContactForm(this, notInList, SelectLocalContactForm.MODE_PRINTER_CONTACT);
                 frm.ShowDialog();
             }
             else
             {
                 string msg = DownloadStatusUtility.StatusToString(DownloadStatus.MAXIMUM_CONTACT_EXEED);
                 MessageBox.Show(msg);
             }
             break;
     }
     BeginInvoke(new Action(() => combbox_add.Text = ContactManagentLibrary.Properties.Resources.add));
 }