示例#1
0
        private void butDelete_Click(object sender, System.EventArgs e)
        {
            if (listMatches.SelectedIndex == -1)
            {
                MessageBox.Show(Lan.g(this, "Please select an item first."));
                return;
            }
            ZipCode ZipCodeCur = (ZipCode)ZipCodes.ALMatches[listMatches.SelectedIndex];

            ZipCodes.Delete(ZipCodeCur);
            changed = true;
            ZipCodes.Refresh();
            //next line might not be right.
            ZipCodes.GetALMatches(ZipCodeCur.ZipCodeDigits);
            FillList();
        }
示例#2
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormZipCodeEdit FormZCE = new FormZipCodeEdit();

            FormZCE.ZipCodeCur = new ZipCode();
            FormZCE.ZipCodeCur.ZipCodeDigits = ((ZipCode)ZipCodes.ALMatches[0]).ZipCodeDigits;
            FormZCE.IsNew = true;
            FormZCE.ShowDialog();
            if (FormZCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            ZipCodes.Refresh();
            ZipCodes.GetALMatches(FormZCE.ZipCodeCur.ZipCodeDigits);
            FillList();
        }
示例#3
0
 private void FillTable()
 {
     ZipCodes.Refresh();
     tbZips.ResetRows(ZipCodes.List.Length);
     tbZips.SetGridColor(Color.Gray);
     tbZips.SetBackGColor(Color.White);
     for (int i = 0; i < ZipCodes.List.Length; i++)
     {
         tbZips.Cell[0, i] = ZipCodes.List[i].ZipCodeDigits;
         tbZips.Cell[1, i] = ZipCodes.List[i].City;
         tbZips.Cell[2, i] = ZipCodes.List[i].State;
         if (ZipCodes.List[i].IsFrequent)
         {
             tbZips.Cell[3, i] = "X";
         }
     }
     tbZips.SelectedRow = -1;
     tbZips.LayoutTables();
 }
示例#4
0
        private void butEdit_Click(object sender, System.EventArgs e)
        {
            if (listMatches.SelectedIndex == -1)
            {
                MessageBox.Show(Lan.g(this, "Please select an item first."));
                return;
            }
            FormZipCodeEdit FormZCE = new FormZipCodeEdit();

            FormZCE.ZipCodeCur = (ZipCode)ZipCodes.ALMatches[listMatches.SelectedIndex];
            FormZCE.ShowDialog();
            if (FormZCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            ZipCodes.Refresh();
            ZipCodes.GetALMatches(FormZCE.ZipCodeCur.ZipCodeDigits);
            FillList();
        }