private void m_cmdQuery_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; this.m_cmdQuery.Enabled = false; clsLisQCBatchSchVO objSch = new clsLisQCBatchSchVO(); try { objSch.m_intQCBatchSeq = int.Parse(this.m_txtQCBatchSeq.Text); } catch { objSch.m_intQCBatchSeq = -1; } objSch.m_intWorkGroupSeq = this.m_cboWorkGroup.Value; if (this.m_txtQCCheckItem.Tag != null) { objSch.m_strQCCheckItem = this.m_txtQCCheckItem.Tag.ToString(); } if (this.m_chkDeviceSeleted.Checked && this.m_cboDevice.SelectedValue != null) { objSch.m_strQCDevice = this.m_cboDevice.SelectedValue.ToString(); } if (this.m_chkQCDateSelected.Checked) { string strMM = this.m_dtpQCDate.Value.ToString("yyyy-MM"); string strMaxDay = DateTime.DaysInMonth(this.m_dtpQCDate.Value.Year, this.m_dtpQCDate.Value.Month).ToString(); objSch.m_datQueryBegin = DateTime.Parse(strMM + "-01 00:00:00"); objSch.m_datQueryEnd = DateTime.Parse(strMM + "-" + strMaxDay + " 23:59:59"); } clsLisQCBatchVO[] objRecordArr = null; long lngRes = clsSchQCBatchSmp.s_object.m_lngFindQCBatchCombinatorial(objSch, out objRecordArr); if (lngRes <= 0) { clsCommonDialog.m_mthShowDBError(); } else { if (objRecordArr == null || objRecordArr.Length == 0) { clsCommonDialog.m_mthShowNoAccordantResult(); } else { m_mthQueryReset(); if (this.QuerySucceed != null) { QuerySucceed(this, new QuerySucceedEventArgs(objRecordArr)); } } } this.m_cmdQuery.Enabled = true; Cursor.Current = Cursors.Default; }
public long m_lngFindQCBatchCombinatorial(clsLisQCBatchSchVO p_objCondition, out clsLisQCBatchVO[] p_objRecordArr) { p_objRecordArr = null; long lngRes = 0; try { lngRes = m_objSvc.m_lngFindQCBatchCombinatorial(m_objPrincipal, p_objCondition, out p_objRecordArr); } catch { lngRes = 0; } return(lngRes); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void m_trvQCBatch_AfterSelect(object sender, TreeViewEventArgs e) { Cursor.Current = Cursors.WaitCursor; if (this.m_trvQCBatch.SelectedNode != null) { TreeNode selectedNode = this.m_trvQCBatch.SelectedNode; string node = selectedNode.Tag as string; DateTime dateTime = this.m_ctlDateSelector.DateStart; DateTime date = dateTime.Date; dateTime = this.m_ctlDateSelector.DateEnd; dateTime = dateTime.Date; dateTime = dateTime.AddDays(1.0); DateTime dateTime2 = dateTime.AddSeconds(-1.0); clsLisQCDataVO[] qcDataVo = null; string strSampleId = null; clsLisQCBatchSchVO qcBatchSchVo = new clsLisQCBatchSchVO(); if (string.IsNullOrEmpty(node)) { int num = Convert.ToInt32(selectedNode.Name); this.m_objCurrentBatch.Reset(); this.m_objCurrentBatch.Load(num, date, dateTime2); int[] batchSeq = new int[] { num }; long num2 = this.m_objCurrentBatch.m_lngQueryDeviceSampleID(batchSeq[0], out strSampleId); dateTime = this.m_ctlDataEditor.m_dtpStartDate.Value; string p_strStartDat = dateTime.ToString("yyyy-MM-dd") + " 00:00:00"; dateTime = this.m_ctlDataEditor.m_dtpEndDate.Value; string p_strEndDat = dateTime.ToString("yyyy-MM-dd") + " 23:59:59"; if (!string.IsNullOrEmpty(strSampleId)) { num2 = m_objCurrentBatch.m_lngReceiveDeviceQCDataBySampleID(strSampleId, p_strStartDat, p_strEndDat, batchSeq, out qcDataVo); if (num2 > 0L && qcDataVo != null && qcDataVo.Length > 0) { this.m_ctlDataEditor.m_mthAddDataTable(qcDataVo); } } } else { if (node != "质控批") { this.m_objCurrentBatch.Reset(); } else { if (selectedNode.Nodes != null && selectedNode.Nodes.Count > 0) { List <int> list = new List <int>(); int num3 = 0; foreach (TreeNode treeNode in selectedNode.Nodes) { int.TryParse(treeNode.Name, out num3); if (num3 > 0) { list.Add(num3); list.Add(Convert.ToInt16(num3.ToString() + "1")); list.Add(Convert.ToInt16(num3.ToString() + "2")); } } if (list.Count > 0) { int[] array2 = new int[list.Count]; array2 = list.ToArray(); qcBatchSchVo.m_strQCSampleLotNO = selectedNode.Text; long num2 = this.m_objCurrentBatch.m_lngQueryDeviceSampleID(array2[0], out strSampleId); dateTime = this.m_ctlDataEditor.m_dtpStartDate.Value; string p_strStartDat = dateTime.ToString("yyyy-MM-dd 00:00:00"); dateTime = this.m_ctlDataEditor.m_dtpEndDate.Value; string p_strEndDat = dateTime.ToString("yyyy-MM-dd 23:59:59"); this.m_objCurrentBatch.Reset(); this.m_objCurrentBatch.Load(list.ToArray(), date, dateTime2); if (!string.IsNullOrEmpty(strSampleId)) { num2 = this.m_objCurrentBatch.m_lngReceiveDeviceQCDataBySampleID(strSampleId, p_strStartDat, p_strEndDat, array2, out qcDataVo); if (num2 > 0L && qcDataVo != null && qcDataVo.Length > 0) { this.m_ctlDataEditor.m_mthAddDataTable(qcDataVo); } } } else { this.m_objCurrentBatch.Reset(); } } } } } Cursor.Current = Cursors.Default; }
public long m_lngFindQCBatchCombinatorial(System.Security.Principal.IPrincipal p_objPrincipal, clsLisQCBatchSchVO p_objCondition, out clsLisQCBatchVO[] p_objRecordArr) { long lngRes = 0; p_objRecordArr = null; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege (p_objPrincipal, "com.digitalwave.iCare.middletier.clsSchQCBatchSvc", "m_lngFindQCBatchCombinatorial"); if (lngRes <= 0) { return(-1); } #region SQL // string strSQL = @"SELECT t1.*, t2.workgroup_name_vchr, t3.devicename_vchr, // t3.device_model_desc_vchr, t4.check_item_name_vchr,t6.lastname_vchr as operator_name // FROM t_opr_lis_qcbatch t1, // t_bse_lis_workgroup t2, // (SELECT * // FROM t_bse_lis_device t31, t_bse_lis_device_model t32 // WHERE t31.device_model_id_chr = t32.device_model_id_chr) t3, // t_bse_lis_check_item t4, // t_bse_employee t6 // WHERE t1.status_int = 1 // AND t1.workgroup_seq_int = t2.workgroup_seq_int(+) // AND t1.deviceid_chr = t3.deviceid_chr(+) // AND t1.check_item_id_chr = t4.check_item_id_chr(+) // AND t1.operator_id_chr = t6.empid_chr(+)"; string strSQL = @"select t1.qcbatch_seq_int, t1.sort_num_int, t1.workgroup_seq_int, t1.deviceid_chr, t1.check_item_id_chr, t1.qcsample_lotno_vchr, t1.qcsample_source_vchr, t1.qcsample_vendor_vchr, t1.reagent_vchr, t1.reagent_batch_vchr, t1.checkmethod_name_vchr, t1.wavelength_num, t1.qcrules_vchr, t1.resultunit_vchr, t1.begin_dat, t1.end_dat, t1.summary_vchr, t1.operator_id_chr, t1.modify_dat, t1.status_int, t1.sort_num_int, t2.workgroup_name_vchr, t3.devicename_vchr, t3.device_model_desc_vchr, t4.device_check_item_name_vchr, t6.lastname_vchr as operator_name from t_opr_lis_qcbatch t1, t_bse_lis_workgroup t2, (select t31.deviceid_chr, t31.devicename_vchr, t32.device_model_desc_vchr, t31.device_model_id_chr from t_bse_lis_device t31, t_bse_lis_device_model t32 where t31.device_model_id_chr = t32.device_model_id_chr) t3, t_bse_lis_device_check_item t4, t_bse_employee t6 where t1.status_int = 1 and t1.workgroup_seq_int = t2.workgroup_seq_int(+) and t1.deviceid_chr = t3.deviceid_chr(+) and t3.device_model_id_chr = t4.device_model_id_chr and t1.check_item_id_chr = t4.device_check_item_id_chr(+) and t1.operator_id_chr = t6.empid_chr(+) "; string strSQL_BatchSeq = " AND t1.qcbatch_seq_int = ?"; string strSQL_WorkGroup = " AND t1.workgroup_seq_int = ?"; string strSQL_Device = " AND t1.deviceid_chr = ?"; string strSQL_CheckItem = " AND t1.check_item_id_chr = ?"; string strSQL_QCSampleLot = " AND t1.qcsample_lotno_vchr = ?"; string strSQL_FromDat = " AND t1.begin_dat < ?"; string strSQL_ToDat = " AND t1.end_dat > ?"; #endregion com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); #region 构造SQL ArrayList arlSQL = new ArrayList(); ArrayList arlPara = new ArrayList(); arlSQL.Add(strSQL_FromDat); arlPara.Add(p_objCondition.m_datQueryEnd); arlSQL.Add(strSQL_ToDat); arlPara.Add(p_objCondition.m_datQueryBegin); if (p_objCondition.m_intQCBatchSeq >= 0) { arlSQL.Add(strSQL_BatchSeq); arlPara.Add(p_objCondition.m_intQCBatchSeq); } if (p_objCondition.m_intWorkGroupSeq >= 0) { arlSQL.Add(strSQL_WorkGroup); arlPara.Add(p_objCondition.m_intWorkGroupSeq); } if (p_objCondition.m_strQCDevice != null && p_objCondition.m_strQCDevice.Trim() != "") { arlSQL.Add(strSQL_Device); arlPara.Add(p_objCondition.m_strQCDevice); } if (p_objCondition.m_strQCCheckItem != null && p_objCondition.m_strQCCheckItem.Trim() != "") { arlSQL.Add(strSQL_CheckItem); arlPara.Add(p_objCondition.m_strQCCheckItem); } if (p_objCondition.m_strQCSampleLotNO != null && p_objCondition.m_strQCSampleLotNO.Trim() != "") { arlSQL.Add(strSQL_QCSampleLot); arlPara.Add(p_objCondition.m_strQCSampleLotNO); } #endregion foreach (object obj in arlSQL) { strSQL += obj.ToString(); } System.Data.IDataParameter[] objIDPArr = null; objHRPSvc.CreateDatabaseParameter(arlPara.Count, out objIDPArr); for (int i = 0; i < arlPara.Count; i++) { objIDPArr[i].Value = arlPara[i]; } try { DataTable dtbResult = null; lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objIDPArr); if (lngRes > 0 && dtbResult != null && dtbResult.Rows.Count > 0) { clsTmdQCBatchSvc objSvc = new clsTmdQCBatchSvc(); p_objRecordArr = new clsLisQCBatchVO[dtbResult.Rows.Count]; for (int i = 0; i < dtbResult.Rows.Count; i++) { p_objRecordArr[i] = new clsLisQCBatchVO(); this.ConstructVO(dtbResult.Rows[i], ref p_objRecordArr[i]); p_objRecordArr[i].m_strWorkGroupName = dtbResult.Rows[i]["workgroup_name_vchr"].ToString(); p_objRecordArr[i].m_strDeviceName = dtbResult.Rows[i]["devicename_vchr"].ToString(); p_objRecordArr[i].m_strCheckItemName = dtbResult.Rows[i]["device_check_item_name_vchr"].ToString(); p_objRecordArr[i].m_strOperatorName = dtbResult.Rows[i]["operator_name"].ToString(); p_objRecordArr[i].m_strSortNum = dtbResult.Rows[i]["sort_num_int"].ToString(); } } objHRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }