public void GetExpermentInfo(string GUIDSTR) { try { string SQL = "select * from " + ExperParmaDBName + " where GUIDSTR = '" + GUIDSTR + "'"; DataTable dt = AccessHelper.GetDataTableFromDB(SQL); if (dt != null) { if (dt.Rows.Count > 0) { ProDefine.g_SMExpermentParam.GUID = Guid.Parse(dt.Rows[0][0].ToString()); ProDefine.g_SMExpermentParam.ExpermentType = Convert.ToInt32(dt.Rows[0][1].ToString()); ProDefine.g_SMExpermentParam.YLType = Convert.ToInt32(dt.Rows[0][2].ToString());; ProDefine.g_SMExpermentParam.JSMode = Convert.ToInt32(dt.Rows[0][3].ToString());; ProDefine.g_SMExpermentParam.YLSetType = Convert.ToInt32(dt.Rows[0][4].ToString()); ProDefine.g_SMExpermentParam.CGTemperature = dt.Rows[0][5].ToString(); ProDefine.g_SMExpermentParam.CGXDSD = dt.Rows[0][6].ToString(); ProDefine.g_SMExpermentParam.CPJXTemperature = dt.Rows[0][7].ToString(); ProDefine.g_SMExpermentParam.CPJXXDSD = dt.Rows[0][8].ToString(); ProDefine.g_SMExpermentParam.JWType = Convert.ToInt32(dt.Rows[0][11].ToString()); ProDefine.g_SMExpermentParam.YBNumber = dt.Rows[0][10].ToString(); ProDefine.g_SMExpermentParam.YLNumber = dt.Rows[0][9].ToString(); ProDefine.g_SMExpermentParam.CGZD = dt.Rows[0][12].ToString(); ProDefine.g_SMExpermentParam.CGDYL = dt.Rows[0][13].ToString(); ProDefine.g_SMExpermentParam.JXZD = dt.Rows[0][14].ToString(); ProDefine.g_SMExpermentParam.JXDYL = dt.Rows[0][15].ToString(); //ProDefine.g_SMExpermentParam.GUID = ProDefine.g_MyProject.GUID; } } SQL = "select * from " + ExperDesignDBName + " where GUIDSTR ='" + GUIDSTR + "'"; DataTable dt1 = AccessHelper.GetDataTableFromDB(SQL); ProDefine.g_SMExpermentDesin.ExpParamList.Clear(); if (dt1 != null) { if (dt1.Rows.Count > 0) { int RowsCount = dt1.Rows.Count; for (int i = 0; i < RowsCount; i++) { SMExpeDesignParam ExperDesign = new SMExpeDesignParam(); ExperDesign.ExpermentTime = Convert.ToInt32(dt1.Rows[i][4].ToString()); ExperDesign.SD = Convert.ToDouble(dt1.Rows[i][2].ToString()); ExperDesign.Temperature = Convert.ToDouble(dt1.Rows[i][1].ToString()); ExperDesign.YBNumber = Convert.ToInt32(dt1.Rows[i][3].ToString()); ProDefine.g_SMExpermentDesin.ExpParamList.Add(ExperDesign); } } } } catch { } }
private void lbExpSave_Click(object sender, EventArgs e) { ProDefine.g_SMExpermentDesin.ExpParamList.Clear(); int RwosCount = this.dataGridView1.Rows.Count - 1; for (int i = 0; i < RwosCount; i++) { SMExpeDesignParam TPParam = new SMExpeDesignParam(); if (this.dataGridView1.Rows[i].Cells[0].Value == null) { return; } TPParam.Temperature = Convert.ToDouble(this.dataGridView1.Rows[i].Cells[0].Value); if (this.dataGridView1.Rows[i].Cells[1].Value == null) { return; } TPParam.SD = Convert.ToDouble(this.dataGridView1.Rows[i].Cells[1].Value); if (this.dataGridView1.Rows[i].Cells[2].Value == null) { return; } TPParam.YBNumber = Convert.ToInt32(this.dataGridView1.Rows[i].Cells[2].Value); if (this.dataGridView1.Rows[i].Cells[3].Value == null) { return; } TPParam.ExpermentTime = Convert.ToInt32(this.dataGridView1.Rows[i].Cells[3].Value); ProDefine.g_SMExpermentDesin.ExpParamList.Add(TPParam); } m_Pro.SaveExpermentDesign(); }