private void UpdateNewsstand(DataGridViewSelectedRowCollection rows, bool update) { List <string> listIDs = new List <string>(); //id list foreach (DataGridViewRow row in rows) { listIDs.Add(db.NewsStandExist(row.Cells[1].Value.ToString())); //populate id list. } if (update) { insNewsstand = new InsertNewsstandForm(db, updateType.update, int.Parse(listIDs[0])); insNewsstand.ShowDialog(); } else //delete { if (LastDeleteNotice(rows.Count)) { int n = 0; string res = ""; foreach (var item in listIDs) { res = db.InsertNewsStand("", "", "", "", "", "", "", "", "", updateType.delete, item.ToString()); if (res == "5") { n++; } } ShowItemsDeletedMessage(n); } else { return; } } }
private void btnAddNewsStand_Click(object sender, EventArgs e) { insNS = new InsertNewsstandForm(_db, updateType.insert); insNS.ShowDialog(); StoreComboBox(comboBusinessName, _db.AllBusinessName()); StoreComboBoxWorkers(); }
private void menuStripInsNewsStand_Click(object sender, EventArgs e) { insNewsstand = new InsertNewsstandForm(db, updateType.insert); DialogResult res = insNewsstand.ShowDialog(); }