private void btnDelete_Click(object sender, EventArgs e) { if (this.gridView1.GetSelectedRows().Count() > 0) { if (MessageBoxDraw.ShowMsg("是否确认删除该防污策略?", MsgType.Question) == DialogResult.OK) { CommunicationEntity ReagentNeedle = new CommunicationEntity(); ReagentNeedleAntifoulingStrategyInfo reagentNeedleAntifoulingStrategyInfo = new ReagentNeedleAntifoulingStrategyInfo(); int selectedHandle; selectedHandle = this.gridView1.GetSelectedRows()[0]; reagentNeedleAntifoulingStrategyInfo.ReagentNeedle = this.gridView1.GetRowCellValue(selectedHandle, "试剂针").ToString(); reagentNeedleAntifoulingStrategyInfo.PolluteProName = this.gridView1.GetRowCellValue(selectedHandle, "污染项目名称").ToString(); reagentNeedleAntifoulingStrategyInfo.PolluteProType = this.gridView1.GetRowCellValue(selectedHandle, "污染项目类型").ToString(); reagentNeedleAntifoulingStrategyInfo.BePollutedProName = this.gridView1.GetRowCellValue(selectedHandle, "被污染项目名称").ToString(); reagentNeedleAntifoulingStrategyInfo.BePollutedProType = this.gridView1.GetRowCellValue(selectedHandle, "被污染项目类型").ToString(); reagentNeedleAntifoulingStrategyInfo.CleaningLiquidName = this.gridView1.GetRowCellValue(selectedHandle, "清洗剂类型").ToString(); reagentNeedleAntifoulingStrategyInfo.CleaningLiquidUseVol = (float)Convert.ToDouble(this.gridView1.GetRowCellValue(selectedHandle, "清洗剂体积").ToString()); reagentNeedleAntifoulingStrategyInfo.CleanTimes = Convert.ToInt32(this.gridView1.GetRowCellValue(selectedHandle, "清洗次数").ToString()); reagentNeedleDic.Clear(); reagentNeedleDic.Add("DeleteReagentNeedle", new object[] { XmlUtility.Serializer(typeof(ReagentNeedleAntifoulingStrategyInfo), reagentNeedleAntifoulingStrategyInfo) }); SendReagentNeedle(reagentNeedleDic); } } }
/// <summary> /// 任务列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lstvQCTask_Click(object sender, EventArgs e) { CommunicationEntity communicationEntity = new CommunicationEntity(); int selectedHandle; if (this.gridView1.GetSelectedRows().Count() > 0) { selectedHandle = this.gridView1.GetSelectedRows()[0]; string strTaskNum = this.gridView1.GetRowCellValue(selectedHandle, "顺序号").ToString(); string projectName = this.gridView1.GetRowCellValue(selectedHandle, "项目名称").ToString(); lstprojectName.Clear(); lstprojectName.Add(projectName); qcTaskDictionary.Clear(); qcTaskDictionary.Add("QueryQCTaskBySampleNum", new object[] { strTaskNum }); ClientSendToServices(qcTaskDictionary); } }
private void btnCancel_Click(object sender, EventArgs e) { AssayProjectInfo assayProInfo = new AssayProjectInfo(); CommunicationEntity communicationEntity = new CommunicationEntity(); int selectedHandle; selectedHandle = this.gridView1.GetSelectedRows()[0]; assayProInfo.ProjectName = this.gridView1.GetRowCellValue(selectedHandle, "项目名称").ToString(); assayProInfo.SampleType = this.gridView1.GetRowCellValue(selectedHandle, "类型").ToString(); if (AssayProInfoForRangeParamEvent != null) { //communicationEntity.StrmethodName = "QueryRangeParamByProNameAndType"; //communicationEntity.ObjParam = XmlUtility.Serializer(typeof(AssayProjectInfo), assayProInfo); rangeParamDic.Clear(); rangeParamDic.Add("QueryRangeParamByProNameAndType", new object[] { XmlUtility.Serializer(typeof(AssayProjectInfo), assayProInfo) }); AssayProInfoForRangeParamEvent(rangeParamDic); } }
private void AppendSenderEmail(Guid enrchEmailDataId, string senderEmail, bool isFreeDomain, Guid primaryContact, TextEntities textEntities) { if (primaryContact.IsEmpty()) { return; } CommunicationEntity senderEmailEte = new CommunicationEntity { Id = Guid.NewGuid(), Value = senderEmail, ContactId = primaryContact, Type = EnrchCommunicationType.Email.ToString(), IsFoundInLastEmail = true, IsPhone = false, IsFreeDomain = isFreeDomain }; if (textEntities.Communications.Contains(senderEmailEte)) { return; } string entityHash = senderEmailEte.GetHash(); var select = (Select) new Select(_userConnection) .Column(Func.Count("Id")) .From("EnrchTextEntity") .Where("Hash").IsEqual(Column.Parameter(entityHash)) .And("ParentId").IsEqual(Column.Parameter(primaryContact)); int emailsWithSameHash = select.ExecuteScalar <int>(); if (emailsWithSameHash > 0) { return; } textEntities.Communications.Add(senderEmailEte); CreateTextEntity(enrchEmailDataId, senderEmailEte, EnrchTextEntityType.Communication, primaryContact, EnrchTextEntitySource.AppDbActivity, entityHash); }
private void simpleButton2_Click(object sender, EventArgs e) { SerialCommunicationInfo serialCommunicationInfo = new SerialCommunicationInfo(); if (cboSerialPort.SelectedIndex < 0) { MessageBoxDraw.ShowMsg("请选择串口!", MsgType.Warning); return; } string message1 = txtCommunicateTime.Text.Trim(); string message2 = txtReConnectTime.Text.Trim(); int result; if (message1 != "") { if (isNumberic(message1, out result)) { serialCommunicationInfo.CommunicateionOvertime = (float)Convert.ToDouble(txtCommunicateTime.Text); } else { MessageBoxDraw.ShowMsg("您的输入有误,请重新输入!", MsgType.Warning); return; } } if (message2 != "") { if (isNumberic(message2, out result)) { serialCommunicationInfo.ReConnectionTime = (float)Convert.ToDouble(txtReConnectTime.Text); } else { MessageBoxDraw.ShowMsg("您的输入有误,请重新输入!", MsgType.Warning); return; } } serialCommunicationInfo.SerialName = cboSerialPort.Text; serialCommunicationInfo.BaudRate = Convert.ToInt32(cboBaudRate.Text); serialCommunicationInfo.DataBits = Convert.ToInt32(cboDataBit.Text); serialCommunicationInfo.StopBits = cboStopBits.Text; serialCommunicationInfo.Parity = cboParity.Text; //serialCommunicationInfo.CommunicateionType= textEdit8.Text ; if (checkEdit1.Checked == true) { serialCommunicationInfo.RealTimeSendResult = true; } else { serialCommunicationInfo.RealTimeSendResult = false; } if (checkEdit2.Checked == true) { serialCommunicationInfo.Reconnection = true; } else { serialCommunicationInfo.Reconnection = false; } if (checkEdit3.Checked == true) { serialCommunicationInfo.StartingUp = true; } else { serialCommunicationInfo.StartingUp = false; } CommunicationEntity NetworkcommunicationEntity = new CommunicationEntity(); if (serialCommunicationInfo != null) { //NetworkcommunicationEntity.StrmethodName = "SerialLISCommunicateUpDate"; //NetworkcommunicationEntity.ObjParam = XmlUtility.Serializer(typeof(SerialCommunicationInfo), serialCommunicationInfo); lisCommDic.Clear(); //修改串口参数信息 lisCommDic.Add("SerialLISCommunicateUpDate", new object[] { XmlUtility.Serializer(typeof(SerialCommunicationInfo), serialCommunicationInfo) }); LISCommunicateLoad(lisCommDic); } }