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

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

                foreach (DevComponents.Editors.ComboItem i in cbxPostal.Items)
                {
                    if (i.Value.ToString().ToLower() == SharedData.sPostal.ToLower())
                    {
                        bExists = true;
                    }
                }

                if (bExists)
                {
                    MessageBox.Show("The address entered already exists.", "Exists", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    string[] sPostal = SharedData.sPostal.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    DevComponents.Editors.ComboItem i = new DevComponents.Editors.ComboItem();
                    i.Value = SharedData.sPostal;
                    i.Text  = sPostal[0] + ", " + sPostal[5];
                    cbxPostal.Items.Add(i);
                    cbxPostal.SelectedIndex = cbxPostal.Items.Count - 1;
                }

                SharedData.sPostal = "";
            }
            return;
        }
예제 #2
0
파일: frmUsers.cs 프로젝트: etechuk/fexipc
        private void btnPostal_Click(object sender, EventArgs e)
        {
            Form frmPostal = new frmPostal();
            DialogResult dlg = frmPostal.ShowDialog();
            if (dlg == DialogResult.OK && SharedData.sPostal.Length > 0)
            {
                bool bExists = false;

                foreach (DevComponents.Editors.ComboItem i in cbxPostal.Items)
                {
                    if (i.Value.ToString().ToLower() == SharedData.sPostal.ToLower())
                    {
                        bExists = true;
                    }
                }

                if (bExists)
                {
                    MessageBox.Show("The address entered already exists.", "Exists", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else
                {
                    string[] sPostal = SharedData.sPostal.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    DevComponents.Editors.ComboItem i = new DevComponents.Editors.ComboItem();
                    i.Value = SharedData.sPostal;
                    i.Text = sPostal[0] + ", " + sPostal[5];
                    cbxPostal.Items.Add(i);
                    cbxPostal.SelectedIndex = cbxPostal.Items.Count - 1;
                }

                SharedData.sPostal = "";
            }
            return;
        }