Пример #1
0
        private void EditCard()
        {
            int row = dataGridCards.CurrentRowIndex;

            if (row == -1)
            {
                return;
            }

            int    id     = Convert.ToInt32(dataGridCards[row, 0]);
            string sn     = dataGridCards[row, 1].ToString();
            string person = dataGridCards[row, 2].ToString();
            string team   = dataGridCards[row, 3].ToString();
            string remark = dataGridCards[row, 4].ToString();

            frmCardItem f = new frmCardItem();

            f.AdeState = ADEState.Edit;
            f.EditId   = id;
            f.CardSN   = sn;
            f.Person   = person;
            f.Remark   = remark;
            f.Team     = team;

            if (f.ShowDialog() == DialogResult.OK)
            {
                Card c = new Card(f.CardSN, f.Person, f.Remark);
                c.Tag = f.Team;
                XGDB.UpdateCard(id, c);
                LoadCardFromDB();
                XGDB.Resolve();
            }
        }