Esempio n. 1
0
        private void m_mthDisplayVO()
        {
            clsLisQCBatchVO objBatch = this.objQCBatch;

            m_txtQCBatchSeq.Text = DBAssist.ToString(objBatch.m_intSeq);
            m_cboWorkGroup.Value = objBatch.m_intWorkGroupSeq;
            if (objQCBatch.m_strDeviceId != string.Empty)
            {
                try { ctlLISDeviceComboBox1.SelectedValue = objBatch.m_strDeviceId; }
                catch { }
                this.m_chkIsMachine.Checked = true;
            }
            else
            {
                this.m_chkIsMachine.Checked = false;
            }
            m_txtQCCheckItem.Tag         = objBatch.m_strCheckItemId;
            m_txtQCCheckItem.Text        = objBatch.m_strCheckItemName;
            m_txtQCSampleLotNO.Text      = objBatch.m_strSampleLotNo;
            m_cboQCSampleSource.Text     = objBatch.m_strSampleSource;
            m_cboQCSqmpleVendor.Text     = objBatch.m_strSampleVendor;
            m_txtReagentLotNO.Text       = objBatch.m_strReagentBatch;
            m_cboReagentVendor.Text      = objBatch.m_strReagent;
            m_cboCheckMethod.Text        = objBatch.m_strCheckmethodName;
            m_txtWaveLength.Text         = DBAssist.ToString(objBatch.m_dblWaveLength);
            m_txtResultUnit.Text         = objBatch.m_strResultUnit;
            m_dtpBeginDate.Value         = objBatch.m_dtBegin;
            m_dtpEndDate.Value           = objBatch.m_dtEnd;
            m_txtAppDoct.m_StrEmployeeID = objBatch.m_strOperatorId;
            m_txtSummary.Text            = objBatch.m_strSummary;

            //质控规则
            //...
            m_dtgQCRules.DataSource = m_dtbGetRulesFromVO();
        }
Esempio n. 2
0
 public long m_lngFindQCBatch(int p_intSeq, bool p_blnExtFind, out clsLisQCBatchVO p_objQCBatch)
 {
     using (clsTmdQCBatchSvc svc = new clsTmdQCBatchSvc())
     {
         return(svc.m_lngFindQCBatch(this.objPrincipal, p_intSeq, p_blnExtFind, out p_objQCBatch));
     }
 }
Esempio n. 3
0
 public void ConstructVO(DataRow p_dtrSource, ref clsLisQCBatchVO p_objQCBatch)
 {
     p_objQCBatch.m_strSortNum         = p_dtrSource["sort_num_int"].ToString().Trim();
     p_objQCBatch.m_intSeq             = DBAssist.ToInt32(p_dtrSource["QCBATCH_SEQ_INT"]);
     p_objQCBatch.m_intWorkGroupSeq    = DBAssist.ToInt32(p_dtrSource["WORKGROUP_SEQ_INT"]);
     p_objQCBatch.m_strDeviceId        = p_dtrSource["DEVICEID_CHR"].ToString().Trim();
     p_objQCBatch.m_strCheckItemId     = p_dtrSource["CHECK_ITEM_ID_CHR"].ToString().Trim();
     p_objQCBatch.m_strSampleLotNo     = p_dtrSource["QCSAMPLE_LOTNO_VCHR"].ToString().Trim();
     p_objQCBatch.m_strSampleSource    = p_dtrSource["QCSAMPLE_SOURCE_VCHR"].ToString().Trim();
     p_objQCBatch.m_strSampleVendor    = p_dtrSource["QCSAMPLE_VENDOR_VCHR"].ToString().Trim();
     p_objQCBatch.m_strReagent         = p_dtrSource["REAGENT_VCHR"].ToString().Trim();
     p_objQCBatch.m_strReagentBatch    = p_dtrSource["REAGENT_BATCH_VCHR"].ToString().Trim();
     p_objQCBatch.m_strCheckmethodName = p_dtrSource["CHECKMETHOD_NAME_VCHR"].ToString().Trim();
     p_objQCBatch.m_dblWaveLength      = DBAssist.ToDouble(p_dtrSource["WAVELENGTH_NUM"]);
     p_objQCBatch.m_strQCRules         = p_dtrSource["QCRULES_VCHR"].ToString().Trim();
     p_objQCBatch.m_strResultUnit      = p_dtrSource["RESULTUNIT_VCHR"].ToString().Trim();
     p_objQCBatch.m_dtBegin            = DBAssist.ToDateTime(p_dtrSource["BEGIN_DAT"]);
     p_objQCBatch.m_dtEnd         = DBAssist.ToDateTime(p_dtrSource["END_DAT"]);
     p_objQCBatch.m_strSummary    = p_dtrSource["SUMMARY_VCHR"].ToString().Trim();
     p_objQCBatch.m_strOperatorId = p_dtrSource["OPERATOR_ID_CHR"].ToString().Trim();
     p_objQCBatch.m_dtModify      = DBAssist.ToDateTime(p_dtrSource["MODIFY_DAT"]);
     try
     {
         p_objQCBatch.m_enmStatus = (enmQCStatus)DBAssist.ToInt32(p_dtrSource["STATUS_INT"]);
     }
     catch
     {
     }
 }
Esempio n. 4
0
 /// <summary>
 /// m_lngInsertQCBatch
 /// </summary>
 /// <param name="p_objQCBatch"></param>
 /// <param name="p_intSeq"></param>
 /// <returns></returns>
 public long m_lngInsertQCBatch(clsLisQCBatchVO p_objQCBatch, out int p_intSeq)
 {
     using (clsTmdQCBatchSvc svc = new clsTmdQCBatchSvc())
     {
         return(svc.m_lngInsertQCBatch(this.objPrincipal, p_objQCBatch, out p_intSeq));
     }
 }
Esempio n. 5
0
        private List <QualityControlRule> m_arrGetRuelsFromVO()
        {
            clsLisQCBatchVO  objBatch = this.objQCBatch;
            QcParserXmlRules parser   = new QcParserXmlRules(objBatch.m_strQCRules);

            return(parser.RuleList);
        }
Esempio n. 6
0
 /// <summary>
 /// m_lngUpdateQCBatch
 /// </summary>
 /// <param name="QCBatch"></param>
 /// <returns></returns>
 public long m_lngUpdateQCBatch(clsLisQCBatchVO QCBatch)
 {
     using (clsTmdQCBatchSvc svc = new clsTmdQCBatchSvc())
     {
         return(svc.m_lngUpdateQCBatch(this.objPrincipal, QCBatch));
     }
 }
Esempio n. 7
0
        private DataTable m_dtbGetRulesFromVO()
        {
            clsLisQCBatchVO objBatch = this.objQCBatch;

            List <QualityControlRule> rules = m_arrGetRuelsFromVO();

            DataTable dtbRules = new DataTable();

            dtbRules.Columns.Add("ruleName", typeof(System.String));
            dtbRules.Columns.Add("ruleChoice", typeof(System.Boolean));
            dtbRules.Columns.Add("ruleWarning", typeof(System.Boolean));

            Hashtable hasRules = new Hashtable();

            if (rules != null)
            {
                foreach (QualityControlRule vo in rules)
                {
                    dtbRules.Rows.Add(vo.Name, true, vo.IsWarning);
                    hasRules.Add(vo.Name, "");
                }
            }


            foreach (clsLisQCRuleVO vo in m_arrGetRulesFromBase())
            {
                if (!hasRules.Contains(vo.m_strName))
                {
                    dtbRules.Rows.Add(vo.m_strName, false, vo.m_enmWarnType == enmQCRuleWarnLevel.Warning?true:false);
                }
            }

            return(dtbRules);
        }
Esempio n. 8
0
        /// <summary>
        /// 质控批类数组
        /// </summary>
        /// <returns></returns>
        public List <clsLisQCBatchVO> GetQCBatchSet()
        {
            //if (this.IsNull)
            //    return null;
            //List<clsLisQCBatchVO> lstQCBatch = new List<clsLisQCBatchVO>();
            //clsLisQCBatchVO temp = null;
            //foreach (clsLisQCBatchVO objBatch in m_objBatchSets)
            //{
            //    temp = new clsLisQCBatchVO();
            //    objBatch.m_mthCopyTo(temp);
            //    lstQCBatch.Add(temp);
            //}
            //return lstQCBatch;
            List <clsLisQCBatchVO> result;

            if (this.IsNull)
            {
                result = null;
            }
            else
            {
                List <clsLisQCBatchVO> list = new List <clsLisQCBatchVO>();
                foreach (clsLisQCBatchVO current in this.m_objBatchSets)
                {
                    clsLisQCBatchVO clsLisQCBatchVO = new clsLisQCBatchVO();
                    current.m_mthCopyTo(clsLisQCBatchVO);
                    list.Add(clsLisQCBatchVO);
                }
                result = list;
            }
            return(result);
        }
Esempio n. 9
0
        public clsLisQCBatchVO GetQCBatchSet()
        {
            clsLisQCBatchVO temp = new clsLisQCBatchVO();

            if (m_objBatchSet != null)
            {
                m_objBatchSet.m_mthCopyTo(temp);
            }
            return(temp);
        }
Esempio n. 10
0
        public long m_lngUpdate(clsLisQCBatchVO p_objRecord)
        {
            long lngRes = 0;

            try
            {
                lngRes = m_objSvc.m_lngUpdate(m_objPrincipal, p_objRecord);
            }
            catch { lngRes = 0; }
            return(lngRes);
        }
Esempio n. 11
0
        /// <summary>
        /// 查找定质控批序号的质控设置
        /// </summary>
        /// <param name="p_intID"></param>
        /// <param name="p_blnExtFind"></param>
        /// <param name="p_objRecord"></param>
        /// <returns></returns>
        public long m_lngFind(int p_intID, bool p_blnExtFind, out clsLisQCBatchVO p_objRecord)
        {
            long lngRes = 0;

            p_objRecord = null;
            try
            {
                lngRes = m_objSvc.m_lngFind(m_objPrincipal, p_intID, p_blnExtFind, out p_objRecord);
            }
            catch { lngRes = 0; }
            return(lngRes);
        }
Esempio n. 12
0
 private void frmQCBatchSet_Load(object sender, EventArgs e)
 {
     if (this.objQCBatch == null)
     {
         this.objQCBatch = new clsLisQCBatchVO();
         this.m_mthResetAll();
     }
     else
     {
         m_mthDisplayVO();
     }
 }
Esempio n. 13
0
        public void m_mthInitalPrintInfo(clsLISQCChartPrintVO objChartVO)
        {
            if (objChartVO == null || objChartVO.objBatch == null || objChartVO.zedChart == null)
            {
                return;
            }

            m_zedGraph   = objChartVO.zedChart;
            m_objQCCon   = objChartVO.objSelectQCCon;
            m_lstQCDatas = objChartVO.objBatch.GetDatas();
            if (m_lstQCDatas != null && m_lstQCDatas.Count > 0)
            {
                m_lstQCDatas.Sort(clsLisQCDataVO.CompareVO);
            }

            m_lstQCReports = objChartVO.objBatch.GetReports();

            m_strBrokeRules = objChartVO.objBatch.BrokenRules;
            m_strQCStatus   = "在控";
            if (string.IsNullOrEmpty(m_strBrokeRules))
            {
                if (m_lstQCReports != null || m_lstQCReports.Count > 0)
                {
                    foreach (clsLisQCReportVO objQCReport in m_lstQCReports)
                    {
                        if (objQCReport.m_enmQCControlStatus == enmQCControlStatus.UnControl)
                        {
                            m_strQCStatus   = "失控";
                            m_strBrokeRules = objQCReport.m_strUnmatchedRule;
                            break;
                        }
                    }
                }
            }
            else
            {
                m_strQCStatus = "失控";
            }

            m_dtStartDate = objChartVO.objBatch.DateBegin;
            m_dtEndDate   = objChartVO.objBatch.DateEnd;

            clsLisQCBatchVO objTemp = objChartVO.objBatch[0];

            m_strWorkGroup      = objTemp.m_strWorkGroupName;
            m_strDevice         = objTemp.m_strDeviceModel;
            m_strItem           = objTemp.m_strCheckItemName;
            m_strQCSampleLotNO  = objTemp.m_strSampleLotNo;
            m_strQCSampleVendor = objTemp.m_strSampleVendor;
            m_strReagentLotNO   = objTemp.m_strReagentBatch;
            m_strReagentVendor  = objTemp.m_strReagent;
        }
Esempio n. 14
0
 private void m_mthListViewItemInit(clsLisQCBatchVO var, ListViewItem item)
 {
     if (item == null || var == null)
     {
         return;
     }
     item.Text = var.m_strSampleLotNo;
     item.SubItems.Add(var.m_strCheckItemName);
     item.SubItems.Add(var.m_strDeviceName);
     item.SubItems.Add(var.m_strWorkGroupName);
     item.SubItems.Add(DBAssist.ToString(var.m_dtBegin, "yyyy-MM-dd"));
     item.SubItems.Add(DBAssist.ToString(var.m_dtEnd, "yyyy-MM-dd"));
     item.SubItems.Add(DBAssist.ToString(var.m_intSeq));
     item.Tag = var.m_intSeq;
 }
Esempio n. 15
0
 private void m_mthListViewItemChange(clsLisQCBatchVO var, ListViewItem item)
 {
     if (item == null || var == null)
     {
         return;
     }
     item.Text             = var.m_strSampleLotNo;
     item.SubItems[1].Text = var.m_strCheckItemName;
     item.SubItems[2].Text = var.m_strDeviceName;
     item.SubItems[3].Text = var.m_strWorkGroupName;
     item.SubItems[4].Text = DBAssist.ToString(var.m_dtBegin, "yyyy-MM-dd");
     item.SubItems[5].Text = DBAssist.ToString(var.m_dtEnd, "yyyy-MM-dd");
     item.SubItems[6].Text = DBAssist.ToString(var.m_intSeq);
     item.Tag = var.m_intSeq;
 }
Esempio n. 16
0
        private void m_cmdDeleteQCBatch_Click(object sender, EventArgs e)
        {
            if (this.m_objCurrentBatch.IsNull)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            this.m_cmdDeleteQCBatch.Enabled = false;

            clsLisQCBatchVO obj = this.m_objCurrentBatch.GetQCBatchSet();

            obj.m_enmStatus = enmQCStatus.Delete;
            long lngRes = clsTmdQCBatchSmp.s_object.m_lngUpdate(obj);

            if (lngRes > 0)
            {
                int intCurrItemIdx = this.m_lsvQCBatch.SelectedIndices[0];
                this.m_lsvQCBatch.SelectedItems[0].Remove();

                int next = -1;
                if (this.m_lsvQCBatch.Items.Count > intCurrItemIdx)
                {
                    next = intCurrItemIdx;
                }
                else if (this.m_lsvQCBatch.Items.Count == intCurrItemIdx && intCurrItemIdx > 0)
                {
                    next = intCurrItemIdx - 1;
                }

                if (next != -1)
                {
                    this.m_lsvQCBatch.Focus();
                    this.m_lsvQCBatch.Items[next].Selected = true;
                }
                else
                {
                    this.m_objCurrentBatch.Reset();
                }
            }
            else
            {
                clsCommonDialog.m_mthShowDBError();
            }

            Cursor.Current = Cursors.Default;
            this.m_cmdDeleteQCBatch.Enabled = true;
        }
Esempio n. 17
0
        /// <summary>
        /// 保存质控批类
        /// </summary>
        /// <param name="p_objRecord"></param>
        /// <returns></returns>
        public long m_lngInsert(clsLisQCBatchVO p_objRecord)
        {
            int  intID  = -1;
            long lngRes = 0;

            try
            {
                lngRes = m_objSvc.m_lngInsert(m_objPrincipal, p_objRecord, out intID);
            }
            catch { lngRes = 0; }
            if (lngRes > 0)
            {
                p_objRecord.m_intSeq = intID;
            }
            return(lngRes);
        }
Esempio n. 18
0
        //private clsDcl_QCDataBusiness m_objDomain = new clsDcl_QCDataBusiness();


        #region 数据提交接口 (在空模型上将不执行任何操作,传入空的参数也不会执行任何操作)
        public void Reset()
        {
            if (this.IsNull)
            {
                return;
            }
            this.m_objBatchSet = null;
            this.m_objConcentrations.Clear();
            this.m_objDatas.Clear();
            this.m_objReports.Clear();
            this.m_strBrokenRules = string.Empty;
            m_datBegin            = DateTime.MinValue;
            m_datEnd = DateTime.MaxValue;

            if (this.Reseted != null)
            {
                Reseted(this, null);
            }
        }
Esempio n. 19
0
        public void UpdateSet(clsLisQCBatchVO p_objSet)
        {
            if (this.IsNull)
            {
                return;
            }
            if (p_objSet != null)
            {
                if (!p_objSet.m_mthEquals(this.m_objBatchSet))
                {
                    p_objSet.m_mthCopyTo(this.m_objBatchSet);
                    this.m_strBrokenRules = string.Empty;

                    if (this.SetChanged != null)
                    {
                        SetChanged(this, null);
                    }
                }
            }
        }
Esempio n. 20
0
        /// <summary>
        /// 质控批类
        /// </summary>
        /// <returns></returns>
        public clsLisQCBatchVO GetQCBatchSet(int p_intBatchSeq)
        {
            if (this.IsNull)
            {
                return(null);
            }

            clsLisQCBatchVO temp = null;

            foreach (clsLisQCBatchVO objBatch in m_objBatchSets)
            {
                if (objBatch.m_intSeq == p_intBatchSeq)
                {
                    temp = new clsLisQCBatchVO();
                    objBatch.m_mthCopyTo(temp);
                    return(temp);
                }
            }
            return(null);
        }
Esempio n. 21
0
        private void m_mthConstructVO()
        {
            clsLisQCBatchVO objBatch = objQCBatch;

            objBatch.m_intWorkGroupSeq  = m_cboWorkGroup.Value;
            objBatch.m_strWorkGroupName = m_cboWorkGroup.Text;
            if (ctlLISDeviceComboBox1.SelectedValue != null && this.m_chkIsMachine.Checked)
            {
                objBatch.m_strDeviceId   = ctlLISDeviceComboBox1.SelectedValue.ToString();
                objBatch.m_strDeviceName = ctlLISDeviceComboBox1.Text;
            }
            else
            {
                objQCBatch.m_strDeviceId = string.Empty;
            }

            objBatch.m_strCheckItemId     = m_txtQCCheckItem.Tag as string;
            objBatch.m_strCheckItemName   = m_txtQCCheckItem.Text;
            objBatch.m_strSampleLotNo     = m_txtQCSampleLotNO.Text.Trim();
            objBatch.m_strSampleSource    = m_cboQCSampleSource.Text;
            objBatch.m_strSampleVendor    = m_cboQCSqmpleVendor.Text;
            objBatch.m_strReagent         = m_cboReagentVendor.Text.Trim();
            objBatch.m_strReagentBatch    = m_txtReagentLotNO.Text.Trim();
            objBatch.m_strCheckmethodName = m_cboCheckMethod.Text;

            try { objBatch.m_dblWaveLength = Convert.ToDouble(m_txtWaveLength.Text.Trim()); }
            catch { objBatch.m_dblWaveLength = DBAssist.NullDouble; }


            objBatch.m_strResultUnit = m_txtResultUnit.Text.Trim();
            objBatch.m_dtBegin       = DateTime.Parse(m_dtpBeginDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
            objBatch.m_dtEnd         = DateTime.Parse(m_dtpEndDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
            objBatch.m_strOperatorId = m_txtAppDoct.m_StrEmployeeID;
            objBatch.m_strSummary    = m_txtSummary.Text;
            //质控规则
            objBatch.m_strQCRules  = m_strConstructXmlRules();
            objQCBatch.m_enmStatus = enmQCStatus.Natrural;
        }
Esempio n. 22
0
        private void m_cmdConfirm_Click(object sender, EventArgs e)
        {
            long lngRes = 0;

            if (!this.m_blnCheckNum())
            {
                return;
            }
            this.m_mthConstructVO();

            if (string.IsNullOrEmpty(objQCBatch.m_strSampleLotNo))
            {
                MessageBox.Show("请输入质控批号!", "iCare");
                return;
            }

            int iSaveType = 1;

            if (this.objQCBatch.m_strCheckItemId == null ||
                this.objQCBatch.m_strCheckItemId == "")
            {
                if (string.IsNullOrEmpty(objQCBatch.m_strDeviceId))
                {
                    MessageBox.Show("请选择要做质控的仪器或项目", "iCare");
                    return;
                }
                if (M_blnCanReturnArr)
                {
                    clsLISCheckItemNode[] objArr = null;
                    clsTmdQCLisSmp.s_object.m_lngGetDeviceQCCheckItemByID(objQCBatch.m_strDeviceId, out objArr);
                    if (objArr == null || objArr.Length <= 0)
                    {
                        MessageBox.Show("请选设置该仪器的质控项目!", "iCare");
                        return;
                    }

                    objQCBatchArr = new clsLisQCBatchVO[objArr.Length];
                    clsLisQCBatchVO objTemp = null;
                    for (int index = 0; index < objArr.Length; index++)
                    {
                        objTemp = new clsLisQCBatchVO();
                        objQCBatch.m_mthCopyTo(objTemp);
                        objTemp.m_strCheckItemId   = objArr[index].strID;
                        objTemp.m_strCheckItemName = objArr[index].strName;

                        objQCBatchArr[index] = objTemp;
                    }

                    iSaveType = 2;
                }
                else
                {
                    MessageBox.Show("请选择要做质控的项目", "iCare");
                    return;
                }
            }
            if (iSaveType == 2)
            {
                lngRes = clsTmdQCBatchSmp.s_object.m_lngInsertArr(ref objQCBatchArr);
            }
            else
            {
                if (m_txtQCBatchSeq.Text == string.Empty)
                {
                    lngRes = clsTmdQCBatchSmp.s_object.m_lngInsert(this.objQCBatch);
                }
                else
                {
                    lngRes = clsTmdQCBatchSmp.s_object.m_lngUpdate(this.objQCBatch);
                }
            }

            if (lngRes <= 0)
            {
                clsCommonDialog.m_mthShowDBError();
            }
            else
            {
                if (iSaveType != 2)
                {
                    objQCBatchArr = new clsLisQCBatchVO[] { objQCBatch };
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }

            //if (this.objQCBatch.m_strCheckItemId == null ||
            //    this.objQCBatch.m_strCheckItemId == "")
            //{
            //    MessageBox.Show("请选择要做质控的项目", "iCare");
            //    return;
            //}

            //if (m_txtQCBatchSeq.Text == string.Empty)
            //{
            //    lngRes = clsTmdQCBatchSmp.s_object.m_lngInsert(this.objQCBatch);
            //}
            //else
            //{
            //    lngRes = clsTmdQCBatchSmp.s_object.m_lngUpdate(this.objQCBatch);
            //}
            //if (lngRes <= 0)
            //{
            //    clsCommonDialog.m_mthShowDBError();
            //}
            //else
            //{
            //    this.DialogResult = DialogResult.OK;
            //    this.Close();
            //}
        }
Esempio n. 23
0
        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);
        }
Esempio n. 24
0
 public clsQCDailyReportToolStrategy(clsLisQCReportVO objReportInfo, clsLisQCBatchVO objBaseInfo)
 {
     m_mthInit();
     this.m_objReportInfo.objReportInfo = objReportInfo;
     this.m_objReportInfo.objBaseInfo   = objBaseInfo;
 }
Esempio n. 25
0
        //public int m_intAdd(clsLisQCDataModule p_objQCModule)
        //{
        //    if (p_objQCModule == null)
        //        return -1;

        //    if (this.IsNull)
        //        m_lstDataModule = new List<clsLisQCDataModule>();

        //    m_lstDataModule.Add(p_objQCModule);
        //    return 1;
        //}

        //public int m_intAdd(clsLisQCConcentrationVO p_objQCcon)
        //{
        //    if (p_objQCcon == null)
        //        return -1;
        //    if (this.IsNull)
        //        return -1;
        //    foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //    {
        //        if (objModule.m_objBatchSet.m_intSeq == p_objQCcon.m_intQCBatchSeq)
        //        {
        //            objModule.m_objConcentrations.Add(p_objQCcon);
        //            return 1;
        //        }
        //    }
        //    return 0;
        //}

        //public int m_intAdd(clsLisQCDataVO p_objQCData)
        //{
        //    if (p_objQCData == null)
        //        return -1;
        //    if (this.IsNull)
        //        return -1;
        //    foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //    {
        //        if (objModule.m_objBatchSet.m_intSeq == p_objQCData.m_intQCBatchSeq)
        //        {
        //            objModule.m_objDatas.Add(p_objQCData);
        //            return 1;
        //        }
        //    }
        //    return 0;
        //}

        //public int m_intAdd(clsLisQCReportVO p_objQCReport)
        //{
        //    if (p_objQCReport == null)
        //        return -1;
        //    if (this.IsNull)
        //        return -1;
        //    foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //    {
        //        if (objModule.m_objBatchSet.m_intSeq == p_objQCReport.m_intQCBatchSeq)
        //        {
        //            objModule.m_objReports.Add(p_objQCReport);
        //            return 1;
        //        }
        //    }
        //    return 0;
        //}

        //public int m_intAddRange(clsLisQCConcentrationVO[] p_objQCconArr)
        //{
        //    if (p_objQCconArr == null || p_objQCconArr.Length <= 0)
        //        return -1;

        //    if (this.IsNull)
        //        return -1;

        //    foreach (clsLisQCConcentrationVO objTemp in p_objQCconArr)
        //    {
        //        foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //        {
        //            if (objModule.m_objBatchSet == null)
        //                continue;

        //            if (objModule.m_objBatchSet.m_intSeq == objTemp.m_intQCBatchSeq)
        //            {
        //                objModule.m_objConcentrations.Add(objTemp);
        //                break;
        //            }
        //        }
        //    }

        //    return 1;
        //}

        //public int m_intAddRange(clsLisQCDataVO[] p_objQCDataArr)
        //{
        //    if (p_objQCDataArr == null || p_objQCDataArr.Length <= 0)
        //        return -1;

        //    if (this.IsNull)
        //        return -1;

        //    foreach (clsLisQCDataVO objTemp in p_objQCDataArr)
        //    {
        //        foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //        {
        //            if (objModule.m_objBatchSet == null)
        //                continue;

        //            if (objModule.m_objBatchSet.m_intSeq == objTemp.m_intQCBatchSeq)
        //            {
        //                objModule.m_objDatas.Add(objTemp);
        //                break;
        //            }
        //        }
        //    }

        //    return 1;
        //}

        //public int m_intAddRange(clsLisQCReportVO[] p_objQCReportArr)
        //{
        //    if (p_objQCReportArr == null || p_objQCReportArr.Length <= 0)
        //        return -1;

        //    if (this.IsNull)
        //        return -1;

        //    foreach (clsLisQCReportVO objTemp in p_objQCReportArr)
        //    {
        //        foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //        {
        //            if (objModule.m_objBatchSet == null)
        //                continue;

        //            if (objModule.m_objBatchSet.m_intSeq == objTemp.m_intQCBatchSeq)
        //            {
        //                objModule.m_objReports.Add(objTemp);
        //                break;
        //            }
        //        }
        //    }

        //    return 1;
        //}

        #endregion

        #region 清除操作

        //public int m_intClearDatas()
        //{
        //    if (this.IsNull)
        //        return 0;

        //    foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //    {
        //        objModule.m_objDatas.Clear();
        //    }
        //    return 1;
        //}

        //public int m_intClearReports()
        //{
        //    if (this.IsNull)
        //        return 0;

        //    foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //    {
        //        objModule.m_objReports.Clear();
        //    }
        //    return 1;
        //}

        //public int m_intClearDataAndReports()
        //{
        //    if (this.IsNull)
        //        return 0;

        //    foreach (clsLisQCDataModule objModule in m_lstDataModule)
        //    {
        //        objModule.m_objDatas.Clear();
        //        objModule.m_objReports.Clear();
        //    }
        //    return 1;

        //}
        #endregion

        #endregion


        public static int CompareQCBatchVO(clsLisQCBatchVO x, clsLisQCBatchVO y)
        {
            int result;

            if (x == null)
            {
                if (y == null)
                {
                    result = 0;
                }
                else
                {
                    result = -1;
                }
            }
            else
            {
                if (y == null)
                {
                    result = 1;
                }
                else
                {
                    int num = string.Compare(x.m_strDeviceId, y.m_strDeviceId);
                    if (num != 0)
                    {
                        result = num;
                    }
                    else
                    {
                        num = string.Compare(x.m_strSampleLotNo, y.m_strSampleLotNo);
                        if (num != 0)
                        {
                            result = num;
                        }
                        else
                        {
                            int num2 = 0;
                            int num3 = 0;
                            int.TryParse(x.m_strSortNum, out num2);
                            int.TryParse(y.m_strSortNum, out num3);
                            if (num2 > num3)
                            {
                                result = 1;
                            }
                            else
                            {
                                if (num2 < num3)
                                {
                                    result = -1;
                                }
                                else
                                {
                                    result = x.m_intSeq - y.m_intSeq;
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 26
0
        /// <summary>
        /// 加载数据
        /// </summary>
        /// <param name="p_intQCBatchSeq"></param>
        /// <param name="p_dtpDateStart"></param>
        /// <param name="p_DateEnd"></param>

        public void Load(int p_intQCBatchSeq, DateTime p_dtpDateStart, DateTime p_DateEnd)
        {
            clsLisQCBatchVO qcBactchVo = null;

            clsLisQCConcentrationVO[] qcConcentrationVo = null;
            clsLisQCDataVO[]          qCDataVo          = null;
            clsLisQCReportVO[]        qCReportVo        = null;
            long num = 0L;

            num = this.m_objManage.m_lngFindQCBatch(p_intQCBatchSeq, true, out qcBactchVo);
            if (num > 0L && qcBactchVo != null)
            {
                num = this.m_objManage.m_lngFindQCConcentration(p_intQCBatchSeq, out qcConcentrationVo);
            }
            if (num > 0L && qcBactchVo != null)
            {
                num = this.m_objManage.m_lngFindQCData(out qCDataVo, p_intQCBatchSeq, p_dtpDateStart, p_DateEnd);
            }
            if (num > 0L && qcBactchVo != null)
            {
                num = this.m_objManage.m_lngFindQCReport(p_intQCBatchSeq, p_dtpDateStart, p_DateEnd, enmQCStatus.Natrural, out qCReportVo);
            }
            if (num > 0L && qcBactchVo != null)
            {
                if (this.m_objBatchSets == null)
                {
                    this.m_objBatchSets = new List <clsLisQCBatchVO>();
                }
                else
                {
                    this.m_objBatchSets.Clear();
                }
                this.m_objConcentrations.Clear();
                this.m_objDatas.Clear();
                this.m_objReports.Clear();
                this.m_strBrokenRules = string.Empty;
                this.m_objBatchSets.Add(qcBactchVo);
                this.m_objBatchSets.Sort(new Comparison <clsLisQCBatchVO>(clsQCBatchNew.CompareQCBatchVO));
                if (qcConcentrationVo != null)
                {
                    this.m_objConcentrations.AddRange(qcConcentrationVo);
                }
                if (qCDataVo != null)
                {
                    this.m_objDatas.AddRange(qCDataVo);
                }
                if (qCReportVo != null)
                {
                    this.m_objReports.AddRange(qCReportVo);
                }
                this.m_datBegin = p_dtpDateStart;
                this.m_datEnd   = p_DateEnd;
                if (this.Loaded != null)
                {
                    this.Loaded(this, null);
                }
            }
            else
            {
                if (num <= 0L)
                {
                    if (this.LoadFailed != null)
                    {
                        this.LoadFailed(this, new clsQCBatchNew.DataLoadFailedEventArgs("读取数据失败."));
                    }
                }
                else
                {
                    if (qcBactchVo == null)
                    {
                        if (this.LoadFailed != null)
                        {
                            this.LoadFailed(this, new clsQCBatchNew.DataLoadFailedEventArgs("指定的质控批不存在."));
                        }
                    }
                }
            }
        }
Esempio n. 27
0
        public void Load(int p_intQCBatchSeq, DateTime p_dtpDateStart, DateTime p_DateEnd)
        {
            clsLisQCBatchVO objBatchSet = null;

            clsLisQCConcentrationVO[] objConcentrations = null;
            clsLisQCDataVO[]          objDatas          = null;
            clsLisQCReportVO[]        objReports        = null;
            long lngRes = 0;

            lngRes = clsTmdQCBatchSmp.s_object.m_lngFind(p_intQCBatchSeq, true, out objBatchSet);
            if (lngRes > 0 && objBatchSet != null)
            {
                lngRes = clsTmdQCBatchConcentrationSmp.s_object.m_lngFind(p_intQCBatchSeq, out objConcentrations);
            }
            if (lngRes > 0 && objBatchSet != null)
            {
                lngRes = clsTmdQCDataSmp.s_object.m_lngFind(out objDatas, p_intQCBatchSeq, p_dtpDateStart, p_DateEnd);
            }
            if (lngRes > 0 && objBatchSet != null)
            {
                lngRes = clsTmdQCReportSmp.s_object.m_lngFind(p_intQCBatchSeq, p_dtpDateStart, p_DateEnd, enmQCStatus.Natrural, out objReports);
            }
            if (lngRes > 0 && objBatchSet != null)
            {
                this.m_objConcentrations.Clear();
                this.m_objDatas.Clear();
                this.m_objReports.Clear();
                this.m_strBrokenRules = string.Empty;

                this.m_objBatchSet = objBatchSet;
                if (objConcentrations != null)
                {
                    this.m_objConcentrations.AddRange(objConcentrations);
                }
                if (objDatas != null)
                {
                    this.m_objDatas.AddRange(objDatas);
                }
                if (objReports != null)
                {
                    this.m_objReports.AddRange(objReports);
                }
                this.m_datBegin = p_dtpDateStart;
                this.m_datEnd   = p_DateEnd;

                if (this.Loaded != null)
                {
                    Loaded(this, null);
                }
            }
            else
            {
                if (lngRes <= 0)
                {
                    if (this.LoadFailed != null)
                    {
                        LoadFailed(this, new DataLoadFailedEventArgs("读取数据失败."));
                    }
                }
                else if (objBatchSet == null)
                {
                    if (this.LoadFailed != null)
                    {
                        LoadFailed(this, new DataLoadFailedEventArgs("指定的质控批不存在."));
                    }
                }
            }
        }