private void MyPlatform_Click(object sender, EventArgs e) { fmMain.pmCurPan += 1; fmMain.pmCurLab += 2; fmMain.pmLabTexts[fmMain.pmCurLab - 1] = pltfmName; fmMain.setCurPmLab(); fmMain.setCurPmPan(); //platform 中点击时,要设置好下一个Product中的内容 DataService service = new DataService(); fmMain.pmPdctPgNow = 1; fmMain.pmPdctList = service.getPdctPageList( fmMain.pmPdctPgNow, fmMain.pmPdctPgSize, this.pltfmName, ref fmMain.pmPdctPgAll); fmMain.pmPanPdcts.Controls.Clear(); fmMain.Refresh(); service.closeCon(); }
private void MyProduct_Click(object sender, EventArgs e) { fmMain.pmCurPan += 1; fmMain.pmCurLab += 2; fmMain.pmLabTexts[fmMain.pmCurLab - 1] = pdctName; fmMain.setCurPmLab(); fmMain.setCurPmPan(); //同时设置好该Product中 包含的Trial List数据 DataService service = new DataService(); fmMain.pmTrialPgNow = 1; fmMain.pmTrialsList = service.getTrPgByPdct(fmMain.pmLabTexts[2], pdctName, fmMain.pmTrialPgNow, fmMain.pmTrialPgSize, ref fmMain.pmTrialPgAll); fmMain.pmPanTrials.Controls.Clear(); fmMain.Refresh(); service.closeCon(); }
//查看该trial private void MyTrial_Click(object sender, EventArgs e) { fmMain.pmCurPan += 1; fmMain.pmCurLab += 1; Cache.trialUniqueStr = trialUniqStr; fmMain.setCurPmLab(); fmMain.setCurPmPan(); //清空datagridview中的数据 fmMain.clearGridView(); //还要为下面的pmHeads 中的数据显示做准备 fmMain.pmHeadShowTrial = trial; fmMain.Refresh(); //连接socket 获取该trial的summary.csv 文件 先 //获取到的summary.csv 文件会先保存在 当前软件目录下并以 userid_datestr.csv 的形式保存 string uniqStr = trial.TrUserId + "_" + trial.TrDate; FileInfo csvFile = new FileInfo(Environment.CurrentDirectory + "\\" + uniqStr + "_0" + ".csv"); //if (!csvFile.Exists) //{ GetCsvSock.dnldCsvFile(trial.TrUserId, trial.TrDate, 0); fmMain.setSumFileComb(0); //设置初始的summary1.csv //} /*else //文件存在 * { * try * { * String line; * String[] split = null; * DataTable table = new DataTable(); * DataRow row = null; * * StreamReader sr = new StreamReader(csvFile.FullName, Encoding.Default); * //创建与数据源对应的数据列 * line = sr.ReadLine(); * split = line.Split(','); * foreach (String colname in split) * { * table.Columns.Add(colname, System.Type.GetType("System.String")); * } * //将数据填入数据表 * int j = 0; * while ((line = sr.ReadLine()) != null) * { * j = 0; * row = table.NewRow(); * split = line.Split(','); * foreach (String colname in split) * { * row[j] = colname; * j++; * } * table.Rows.Add(row); * } * sr.Close(); * //使用代理更新FmMain 中的DataGridView * fmMain.showDataview(table.DefaultView); * } * catch (Exception vErr) * { * MessageBox.Show(vErr.Message); * } * finally * { * GC.Collect(); * } * }*/ // 判断dict 文件是否存在 if (!File.Exists(Environment.CurrentDirectory + "\\" + uniqStr + ".dict")) //不存在,在getcsvSock 中更新可用 { fmMain.disablePic(); } else { fmMain.enablePic(); } #region 行不通的方法 //try 第二种方法 /* * { * Socket csvSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); * IPAddress ip = IPAddress.Parse(ContantInfo.SockServ.ip); * csvSock.Connect(ip, Int32.Parse(ContantInfo.SockServ.port)); * * Thread csvRecvMsgTh = new Thread(csvRecv); * csvRecvMsgTh.IsBackground = false; * csvRecvMsgTh.Start(csvSock); * MyLogger.WriteLine("csv 监听消息线程:" + csvRecvMsgTh.ToString()); * } * catch * { * * }*/ #endregion }