예제 #1
0
        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;
                }
            }
        }
예제 #2
0
 private void btnAddMagazine_Click(object sender, EventArgs e)
 {
     insMag = new InsertMagazineForm(_db, updateType.insert);
     insMag.ShowDialog();
     StoreComboBox(comboMagTitle, _db.AllMagazinesName());
 }
예제 #3
0
 private void menuStripInsMagazine_Click(object sender, EventArgs e)
 {
     insMagazine = new InsertMagazineForm(db, updateType.insert);
     insMagazine.ShowDialog();
 }
예제 #4
0
 private void btnAddMagName_Click(object sender, EventArgs e)
 {
     insMagazine = new InsertMagazineForm(_db, updateType.insert);
     insMagazine.ShowDialog();
     StoreComboBoxMagName();
 }