private void UpdateMagRelase(DataGridViewSelectedRowCollection rows, bool update) { List <string> listIDs = new List <string>(); //id list foreach (DataGridViewRow row in rows) { listIDs.Add(db.MagRelaseExist(db.MagazineExist(row.Cells[0].Value.ToString()), row.Cells[1].Value.ToString())); //populate id list. } if (update) { insMagRelase = new InsertMagRelaseForm(db, updateType.update, int.Parse(listIDs[0])); insMagRelase.ShowDialog(); } else //delete { if (LastDeleteNotice(rows.Count)) { int n = 0; string res = ""; foreach (var item in listIDs) { res = db.InsertMagRelase("", (-1).ToString(), "", "", (0.0).ToString(), 0.ToString(), updateType.delete, item.ToString()); MessageBox.Show(item.ToString()); if (res == "5") { n++; } } ShowItemsDeletedMessage(n); } else { return; } } }
private void btnAddMagRelase_Click(object sender, EventArgs e) { insMagRelase = new InsertMagRelaseForm(_db, updateType.insert); insMagRelase.ShowDialog(); StoreComboBox(comboMagRelase, _db.RelaseNumbersByMagName(comboMagTitle.Text)); }
private void menuStripInsMagRelase_Click(object sender, EventArgs e) { insMagRelase = new InsertMagRelaseForm(db, updateType.insert); insMagRelase.ShowDialog(); }