Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                var dialog = new frmDial();
                dialog.Text = btnAdd.Text;
                if (dialog.ShowDialog(true) == System.Windows.Forms.DialogResult.OK)
                {
                    var dialContent = dialog.DialContent;

                    if (this.IsNumberExist(dialContent.PhoneNumber))
                    {
                        MsgBox.Info(ConfigHelper.GetString("AlreadyExist"), dialContent.PhoneNumber);
                        return;
                    }

                    ListViewItem item = new ListViewItem();
                    item.Text = dialContent.PhoneNumber;
                    item.SubItems.Add(dialContent.PhoneType.ToString());
                    item.SubItems.Add(dialContent.CallType.ToString());
                    item.Tag = dialContent;

                    this.lvwMembers.Items.Add(item);
                }
            }
            catch
            {
                MsgBox.Error("occur exception");
            }
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddMember_Click(object sender, EventArgs e)
        {
            try
            {
                var dialog = new frmDial(true);
                dialog.Text = btnAddMember.Text;
                if (dialog.ShowDialog(true) == System.Windows.Forms.DialogResult.OK)
                {
                    var content = dialog.DialContent;

                    if (this.FindDialContent(content.PhoneNumber) != null)
                    {
                        MsgBox.Info(ConfigHelper.GetString("AlreadyExist"), content.PhoneNumber);

                        return;
                    }
                    if (!this.IsValidPhoneNumber(content.PhoneNumber))
                    {
                        MsgBox.Info("Invalid phone number.");

                        return;
                    }
                    content.Status = MeetingStatus.Loading;

                    this.AddDialContent(content);

                    if (this.Device != null)
                    {
                        this.Device.InviteMeetingMember(this.MeetingId, content);
                    }
                }
            }
            catch
            {
                MsgBox.Error("occur exception");
            }
        }