private void SaveMoistureDetectionCfg() { MoistureDetectionRulesCreator creator = new MoistureDetectionRulesCreator(); string cfgPath = System.IO.Directory.GetCurrentDirectory() + "\\moistureDetectRule.xml"; creator.SaveMoistureDetectionParams(Common.OrganizationID, cfgPath); }
/// <summary> /// 根据质检编号获取总水分点数 /// </summary> /// <param name="QcInfoID">质检编号</param> /// <returns></returns> public static void GetSumWaterCount(int QcInfoID) { try { //确定规则后这里获取包数和每包针数要修改.如果完全由DTS抽包就到接口表获取抽包号 //如果系统也要抽包就到Packets表里面获取DTS和质检系统抽包。 //关于针数可以按照总包数<=50每包测8针 总包数>50每包测4针 DataTable dt = LinQBaseDao.Query("select Packets_DTS,Packets_this from Packets where Packets_QCInfo_DRAW_EXAM_INTERFACE_ID=(select QCInfo_DRAW_EXAM_INTERFACE_ID from QCInfo where QCInfo_ID=" + QcInfoID + ")").Tables[0]; if (dt.Rows.Count > 0) { string Packets_DTS = dt.Rows[0]["Packets_DTS"].ToString(); string Packets_this = dt.Rows[0]["Packets_this"].ToString(); if (Packets_this.Length > 0) { Packets_DTS += "," + Packets_this; } testBags = Packets_DTS.Split(','); //if (ItemMoist == 0) //{ // testBagWaterCount = ItemMoistCount; // SumWaterCount = testBags.Count() * testBagWaterCount; //} //else //{ // testBagWaterCount = 0; // SumWaterCount = ItemMoistCount; //} //yk2016.4.25号暂时修改 MoistureDetectionRulesCreator ruleCreator = new MoistureDetectionRulesCreator(); SumWaterCount = ruleCreator.GetSumWaterCount(Common.OrganizationID, testBags, out testBagWaterCount); } else { SumWaterCount = 0; } } catch (Exception) { SumWaterCount = 0; } }
//private void txtMoistCount_TextChanged(object sender, EventArgs e) //{ // try // { // string str = txtMoistCount.Text.Trim(); // if (!string.IsNullOrEmpty(str)) // { // int s = Convert.ToInt32(str); // } // } // catch (Exception) // { // txtMoistCount.Text = ""; // } //} private void buttonMoistureDetectionRules_Click(object sender, EventArgs e) { MoistureDetectionRulesCreator creator = new MoistureDetectionRulesCreator(); creator.ShowSetupForm(Common.OrganizationID); }