private void EditKurator(object sender, EventArgs e) { var selitem = _lviews[2].SelectedItems[0]; AddEditKuratorsForm aekf = new AddEditKuratorsForm(); sqlmgr.Reconnect(); aekf.SetKuratorsDS(sqlmgr.GetSotrudniki(false)); sqlmgr.Disconnect(); aekf.SetItemForEditing(selitem.Tag); var dr = aekf.ShowDialog(); if (dr == DialogResult.OK) { sqlmgr.Reconnect(); //sqlmgr.UpdateCardKuratorInfo(_card_id, selitem.Tag as Kurator); sqlmgr.Disconnect(); selitem.SubItems[1].Text = (selitem.Tag as Kurator).Info; } }
private void AddKurator(object sender, EventArgs e) { AddEditKuratorsForm aekf = new AddEditKuratorsForm(); sqlmgr.Reconnect(); aekf.SetKuratorsDS(sqlmgr.GetSotrudniki(false)); sqlmgr.Disconnect(); aekf.CreateNewItem(); var dr = aekf.ShowDialog(); if (dr == DialogResult.OK) { sqlmgr.Reconnect(); sqlmgr.AddCardKuratorInfo(_card_id, (Kurator)aekf.EditableItem); sqlmgr.Disconnect(); var ds = (Kurators)_lviews[2].DataSource; ds.Add((Kurator)aekf.EditableItem); _lviews[2].RefreshDataSource(); } }