private void FillGrid() { ZipCodes.RefreshCache(); _listZipCodes = ZipCodes.GetDeepCopy(); gridZipCode.BeginUpdate(); gridZipCode.Columns.Clear(); ODGridColumn col; col = new ODGridColumn(Lan.g(this, "ZipCode"), 75); gridZipCode.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "City"), 270); gridZipCode.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "State"), 50); gridZipCode.Columns.Add(col); col = new ODGridColumn(Lan.g(this, "Frequent"), 80); gridZipCode.Columns.Add(col); gridZipCode.Rows.Clear(); ODGridRow row; foreach (ZipCode zip in _listZipCodes) { row = new ODGridRow(); row.Cells.Add(zip.ZipCodeDigits); row.Cells.Add(zip.City); row.Cells.Add(zip.State); row.Cells.Add((zip.IsFrequent ? "X" : "")); row.Tag = zip; gridZipCode.Rows.Add(row); } gridZipCode.EndUpdate(); }
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 = _listZipCodes[listMatches.SelectedIndex]; ZipCodes.Delete(ZipCodeCur); changed = true; ZipCodes.RefreshCache(); FillList(); }
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.RefreshCache(); //next line might not be right. ZipCodes.GetALMatches(ZipCodeCur.ZipCodeDigits); FillList(); }
private void butAdd_Click(object sender, System.EventArgs e) { FormZipCodeEdit FormZCE = new FormZipCodeEdit(); FormZCE.ZipCodeCur = new ZipCode(); FormZCE.ZipCodeCur.ZipCodeDigits = (_listZipCodes[0]).ZipCodeDigits; FormZCE.IsNew = true; FormZCE.ShowDialog(); if (FormZCE.DialogResult != DialogResult.OK) { return; } changed = true; ZipCodes.RefreshCache(); ZipCodes.GetALMatches(FormZCE.ZipCodeCur.ZipCodeDigits); FillList(); }
private void FillTable() { ZipCodes.RefreshCache(); 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(); }
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 = _listZipCodes[listMatches.SelectedIndex]; FormZCE.ShowDialog(); if (FormZCE.DialogResult != DialogResult.OK) { return; } changed = true; ZipCodes.RefreshCache(); ZipCodes.GetALMatches(FormZCE.ZipCodeCur.ZipCodeDigits); FillList(); }