private void UpdateMagazine(DataGridViewSelectedRowCollection rows, bool update) { List <string> listIDs = new List <string>(); //id list foreach (DataGridViewRow row in rows) { listIDs.Add(db.MagazineExist(row.Cells[0].Value.ToString())); //populate id list. } if (update) { insMagazine = new InsertMagazineForm(db, updateType.update, int.Parse(listIDs[0])); insMagazine.ShowDialog(); } else //delete { if (LastDeleteNotice(rows.Count)) { int n = 0; string res = ""; foreach (var item in listIDs) { res = db.InsertMagazine("", "", "", "", updateType.delete, item.ToString()); if (res == "6") { n++; } } ShowItemsDeletedMessage(n); } else { return; } } }
private void btnAddMagazine_Click(object sender, EventArgs e) { insMag = new InsertMagazineForm(_db, updateType.insert); insMag.ShowDialog(); StoreComboBox(comboMagTitle, _db.AllMagazinesName()); }
private void menuStripInsMagazine_Click(object sender, EventArgs e) { insMagazine = new InsertMagazineForm(db, updateType.insert); insMagazine.ShowDialog(); }
private void btnAddMagName_Click(object sender, EventArgs e) { insMagazine = new InsertMagazineForm(_db, updateType.insert); insMagazine.ShowDialog(); StoreComboBoxMagName(); }