示例#1
0
 //打印选中的学生简历
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         myds        = SelectStuInfo("编号", dgvInfo.Rows[e.RowIndex].Cells[0].Value.ToString());
         strName     = myds.Tables[0].Rows[0][1].ToString();
         strSex      = myds.Tables[0].Rows[0][2].ToString();
         strBirthday = myds.Tables[0].Rows[0][3].ToString();
         strNPlace   = myds.Tables[0].Rows[0][4].ToString();
         strAddress  = myds.Tables[0].Rows[0][5].ToString();
         strNation   = myds.Tables[0].Rows[0][6].ToString();
         strSGao     = myds.Tables[0].Rows[0][7].ToString() + "cm";
         strTZhong   = myds.Tables[0].Rows[0][8].ToString() + "kg";
         strHunYin   = myds.Tables[0].Rows[0][9].ToString();
         MemoryStream MStream = new MemoryStream((byte[])myds.Tables[0].Rows[0][10]);
         imgPhoto   = Image.FromStream(MStream); //记录学生头像
         strGZJL    = myds.Tables[0].Rows[0][11].ToString();
         strBYYX    = myds.Tables[0].Rows[0][12].ToString();
         strXUELLI  = myds.Tables[0].Rows[0][13].ToString();
         strBYSJ    = myds.Tables[0].Rows[0][15].ToString();
         strZHUANYE = myds.Tables[0].Rows[0][16].ToString();
         strWAIYU   = myds.Tables[0].Rows[0][17].ToString();
         strYPZW    = myds.Tables[0].Rows[0][18].ToString();
         strGZNX    = myds.Tables[0].Rows[0][19].ToString() + "年";
         strQZLX    = myds.Tables[0].Rows[0][20].ToString();
         strSalary  = myds.Tables[0].Rows[0][21].ToString();
         strGZDQ    = myds.Tables[0].Rows[0][22].ToString();
         strTECHANG = myds.Tables[0].Rows[0][23].ToString();
         strTel     = myds.Tables[0].Rows[0][24].ToString();
         strEmail   = myds.Tables[0].Rows[0][25].ToString();
         frmPrint frmprint = new frmPrint();
         frmprint.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#2
0
 //打印选中的学生简历
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         myds = SelectStuInfo("编号", dgvInfo.Rows[e.RowIndex].Cells[0].Value.ToString());
         strName = myds.Tables[0].Rows[0][1].ToString();
         strSex = myds.Tables[0].Rows[0][2].ToString();
         strBirthday = myds.Tables[0].Rows[0][3].ToString();
         strNPlace = myds.Tables[0].Rows[0][4].ToString();
         strAddress = myds.Tables[0].Rows[0][5].ToString();
         strNation = myds.Tables[0].Rows[0][6].ToString();
         strSGao = myds.Tables[0].Rows[0][7].ToString() + "cm";
         strTZhong = myds.Tables[0].Rows[0][8].ToString() + "kg";
         strHunYin = myds.Tables[0].Rows[0][9].ToString();
         MemoryStream MStream = new MemoryStream((byte[])myds.Tables[0].Rows[0][10]);
         imgPhoto = Image.FromStream(MStream);  //记录学生头像
         strGZJL = myds.Tables[0].Rows[0][11].ToString();
         strBYYX = myds.Tables[0].Rows[0][12].ToString();
         strXUELLI = myds.Tables[0].Rows[0][13].ToString();
         strBYSJ = myds.Tables[0].Rows[0][15].ToString();
         strZHUANYE = myds.Tables[0].Rows[0][16].ToString();
         strWAIYU = myds.Tables[0].Rows[0][17].ToString();
         strYPZW = myds.Tables[0].Rows[0][18].ToString();
         strGZNX = myds.Tables[0].Rows[0][19].ToString() + "年";
         strQZLX = myds.Tables[0].Rows[0][20].ToString();
         strSalary = myds.Tables[0].Rows[0][21].ToString();
         strGZDQ = myds.Tables[0].Rows[0][22].ToString();
         strTECHANG = myds.Tables[0].Rows[0][23].ToString();
         strTel = myds.Tables[0].Rows[0][24].ToString();
         strEmail = myds.Tables[0].Rows[0][25].ToString();
         frmPrint frmprint = new frmPrint();
         frmprint.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }