예제 #1
0
파일: frmUsers.cs 프로젝트: etechuk/fexipc
        private void btnPhone_Click(object sender, EventArgs e)
        {
            Form         frmPhone = new frmPhone();
            DialogResult dlg      = frmPhone.ShowDialog();

            if (dlg == DialogResult.OK && SharedData.sPhone.Length > 0)
            {
                bool bExists = false;

                foreach (string s in cbxPhone.Items)
                {
                    if (s.ToLower() == SharedData.sPhone.ToLower())
                    {
                        bExists = true;
                    }
                }

                if (bExists)
                {
                    MessageBox.Show("The number entered already exists.", "Exists", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    cbxPhone.Items.Add(SharedData.sPhone);
                    cbxPhone.SelectedIndex = cbxPhone.Items.Count - 1;
                }

                SharedData.sPhone = "";
            }
            return;
        }
예제 #2
0
        private void btCon_Click(object sender, EventArgs e)
        {
            frmPhone frm = new frmPhone();

            if (frm.ShowDialog() == DialogResult.OK)
            {
                phone = frm.txPhone;
                Connect();
                lstContent.Items.Clear();
            }
        }
예제 #3
0
파일: frmUsers.cs 프로젝트: etechuk/fexipc
        private void btnPhone_Click(object sender, EventArgs e)
        {
            Form frmPhone = new frmPhone();
            DialogResult dlg = frmPhone.ShowDialog();
            if (dlg == DialogResult.OK && SharedData.sPhone.Length > 0)
            {
                bool bExists = false;

                foreach (string s in cbxPhone.Items)
                {
                    if (s.ToLower() == SharedData.sPhone.ToLower())
                    {
                        bExists = true;
                    }
                }

                if (bExists)
                {
                    MessageBox.Show("The number entered already exists.", "Exists", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    cbxPhone.Items.Add(SharedData.sPhone);
                    cbxPhone.SelectedIndex = cbxPhone.Items.Count - 1;
                }

                SharedData.sPhone = "";
            }
            return;
        }