예제 #1
0
 /// <summary>
 /// 老师修改学生信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         if (Istuid >= 0)
         {
             StudentUpData fin = new StudentUpData(UpdataGridView12, Istuid);
             fin.ShowDialog();
         }
         else if (Str != null)
         {
             string        selectId = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
             StudentUpData f        = new StudentUpData(UpdataGridView1, selectId);
             f.ShowDialog();
         }
     }
     catch
     {
         MessageBox.Show("选择要修改的行");
     }
 }
예제 #2
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            StudentUpData f = new StudentUpData(UpdataGridView11, null);

            f.ShowDialog();
        }