private void btn_AddStudent_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (f_EditStudent == null || f_EditStudent.IsDisposed) { f_EditStudent = new Forms.FormEditStudent(); f_EditStudent.UpdataDatabaseView += () => { SqlUtils.UpdataDatabaseView(dataGridView_Main); }; f_EditStudent.Show(); } else { f_EditStudent.Show(); } }
private void btn_EditStudent_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { string strId = dataGridView_Main.SelectedRows[0].Cells[0].Value.ToString(), strSId = dataGridView_Main.SelectedRows[0].Cells[1].Value.ToString(), strSName = dataGridView_Main.SelectedRows[0].Cells[2].Value.ToString(), strSSex = dataGridView_Main.SelectedRows[0].Cells[3].Value.ToString(), strSBirth = dataGridView_Main.SelectedRows[0].Cells[4].Value.ToString(), strSHome = dataGridView_Main.SelectedRows[0].Cells[5].Value.ToString(); IPoint pPoint = AeUtils.GetPointFromId(strId); if (f_EditStudent == null || f_EditStudent.IsDisposed) { f_EditStudent = new Forms.FormEditStudent(pPoint, strId, strSId, strSName, strSSex, strSBirth, strSHome); f_EditStudent.UpdataDatabaseView += () => { SqlUtils.UpdataDatabaseView(dataGridView_Main); }; f_EditStudent.Show(); } else { f_EditStudent.Show(); } }