예제 #1
0
        //取消删除
        private void m_cmdCancelDelete_Click(object sender, EventArgs e)
        {
            if (this.m_lsvConcentration.SelectedItems.Count <= 0)
            {
                return;
            }
            Cursor.Current = Cursors.WaitCursor;
            this.m_cmdCancelDelete.Enabled = false;

            clsLisQCConcentrationVO obj     = (clsLisQCConcentrationVO)this.m_lsvConcentration.SelectedItems[0].Tag;
            clsLisQCConcentrationVO objCopy = new clsLisQCConcentrationVO();

            obj.m_mthCopyTo(objCopy);
            objCopy.m_enmStatus = enmQCStatus.Natrural;

            long lngRes = clsTmdQCBatchConcentrationSmp.s_object.m_lngUpdate(objCopy);

            if (lngRes > 0)
            {//成功
                obj.m_enmStatus = enmQCStatus.Natrural;
                this.m_objDeletedQCContrations.Remove(obj);
                this.m_objQCContrations.Add(obj);
                //
                this.m_lsvConcentration.SelectedItems[0].SubItems[6].Text = "";
                this.m_lsvConcentration.SelectedItems[0].ForeColor        = this.m_lsvConcentration.ForeColor;
                this.m_lsvConcentration_SelectedIndexChanged(this.m_lsvConcentration, null);
            }
            else
            {//失败
                clsCommonDialog.m_mthShowDBError();
            }

            this.m_cmdCancelDelete.Enabled = true;
            Cursor.Current = Cursors.Default;
        }
예제 #2
0
        private void m_mthDrawLeveyStyle(clsLisQCConcentrationVO p_con)
        {
            GraphPane myPane = m_zedChart.GraphPane;

            float X  = (float)p_con.m_dblAVG;
            float SD = (float)p_con.m_dblSD;

            XDate xdtBegin = XDate.DateTimeToXLDate(m_objBatch.DateBegin);
            XDate xdtEnd   = XDate.DateTimeToXLDate(m_objBatch.DateEnd);

            myPane.YAxis.Max     = X + 4f * SD;
            myPane.YAxis.Min     = X - 4f * SD;
            myPane.YAxis.BaseTic = myPane.YAxis.Min;

            myPane.YAxis.MinorStep = (double)SD;
            //string[] labels = { "4.3", "5.8", "6.3", "7.3", "7.8", "8.3" };
            //myPane.YAxis.IsTicsBetweenLabels = false;
            //myPane.YAxis.TextLabels = labels;
            //myPane.YAxis.Type = AxisType.Text;
            myPane.YAxis.Step        = (double)SD;
            myPane.YAxis.ScaleFormat = "0.00";


            myPane.XAxis.Min        = (double)xdtBegin;
            myPane.XAxis.Max        = (double)xdtEnd;
            myPane.XAxis.BaseTic    = (double)xdtBegin;
            myPane.XAxis.IsShowGrid = false;

            myPane.AxisFill = new Fill(Color.White, Color.LightGray, 45.0f);
        }
예제 #3
0
        public long m_lngUpdate(System.Security.Principal.IPrincipal p_objPrincipal,
                                clsLisQCConcentrationVO p_objQCConcentration)
        {
            long lngRes = 0;
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, m_strCurrentSvcDetailName, "m_lngUpdate");
            if (lngRes <= 0)
            {
                return(-1);
            }
            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();


            try
            {
                System.Data.IDataParameter[] objODPArr = GetUpdateDataParameterArr(p_objQCConcentration);
                long lngRecEff = -1;
                //往表增加记录
                lngRes = 0;
                lngRes = objHRPSvc.lngExecuteParameterSQL(m_strUpdateSql, ref lngRecEff, objODPArr);
                objHRPSvc.Dispose();
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
            }
            return(lngRes);
        }
예제 #4
0
파일: ctlQCChartNew.cs 프로젝트: ewin66/HIS
        /// <summary>
        /// 根据浓度的真值与SD值画Levery曲线样式
        /// </summary>
        /// <param name="p_con"></param>
        private void m_mthDrawLeveyStyle(clsLisQCConcentrationVO p_con)
        {
            GraphPane myPane = m_zedChart.GraphPane;

            float X  = (float)p_con.m_dblAVG;
            float SD = (float)p_con.m_dblSD;

            XDate xdtBegin = XDate.DateTimeToXLDate(m_objBatch.DateBegin);
            XDate xdtEnd   = XDate.DateTimeToXLDate(m_objBatch.DateEnd);

            myPane.YAxis.Max     = X + 4f * SD;
            myPane.YAxis.Min     = X - 4f * SD;
            myPane.YAxis.BaseTic = myPane.YAxis.Min;

            myPane.YAxis.MinorStep = (double)SD;

            myPane.YAxis.Step        = (double)SD;
            myPane.YAxis.ScaleFormat = "0.00";


            myPane.XAxis.Min        = (double)xdtBegin;
            myPane.XAxis.Max        = (double)xdtEnd;
            myPane.XAxis.BaseTic    = (double)xdtBegin;
            myPane.XAxis.IsShowGrid = false;

            myPane.AxisFill = new Fill(Color.White, Color.LightGray, 45.0f);
        }
예제 #5
0
 public long m_lngUpdateSDXCV(clsLisQCConcentrationVO p_objQCConcentration)
 {
     using (clsTmdQCBatchSvc svc = new clsTmdQCBatchSvc())
     {
         return(svc.m_lngUpdateSDXCV(this.objPrincipal, p_objQCConcentration));
     }
 }
예제 #6
0
파일: clsQCBatchNew.cs 프로젝트: ewin66/HIS
 public void UpdateConcentrations(List <clsLisQCConcentrationVO> p_objConcentrations, int p_intQCBatchSeq)
 {
     if (!this.IsNull)
     {
         if (p_objConcentrations != null)
         {
             for (int i = 0; i < this.m_objConcentrations.Count; i++)
             {
                 if (this.m_objConcentrations[i].m_intQCBatchSeq == p_intQCBatchSeq)
                 {
                     this.m_objConcentrations.RemoveAt(i);
                     i--;
                 }
             }
             this.m_strBrokenRules = string.Empty;
             foreach (clsLisQCConcentrationVO current in p_objConcentrations)
             {
                 clsLisQCConcentrationVO clsLisQCConcentrationVO = new clsLisQCConcentrationVO();
                 current.m_mthCopyTo(clsLisQCConcentrationVO);
                 this.m_objConcentrations.Add(clsLisQCConcentrationVO);
             }
             if (this.ConcentrationChanged != null)
             {
                 this.ConcentrationChanged(this, null);
             }
         }
     }
 }
예제 #7
0
        public long m_lngFind(System.Security.Principal.IPrincipal p_objPrincipal, int p_intQCBatchSeq,
                              int p_intConcentrationSeq, out clsLisQCConcentrationVO p_objQCConcentration)
        {
            long lngRes = 0;

            p_objQCConcentration = null;
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, m_strCurrentSvcDetailName, "m_lngFind");
            if (lngRes <= 0)
            {
                return(-1);
            }
            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
            try
            {
                System.Data.IDataParameter[] objODPArr =
                    clsPublicSvc.m_objConstructIDataParameterArr(p_intQCBatchSeq, p_intConcentrationSeq);

                DataTable dtbResult = null;
                lngRes = 0;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(m_strFindSql, ref dtbResult, objODPArr);
                objHRPSvc.Dispose();
                if (lngRes == 1 && dtbResult != null && dtbResult.Rows.Count > 0)
                {
                    p_objQCConcentration = new clsLisQCConcentrationVO();
                    this.ConstructVO(dtbResult.Rows[0], ref p_objQCConcentration);
                }
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
            }
            return(lngRes);
        }
예제 #8
0
 private void m_dtgEditor_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
     {
         DataRow row = ((DataRowView)this.m_dtgEditor.Rows[e.RowIndex].DataBoundItem).Row;
         if (row["strdate"].ToString().Trim() == this.m_strLocalConn)
         {
             string name = this.m_dtgEditor.Columns[e.ColumnIndex].Name;
             if (!name.Contains("date"))
             {
                 row = ((DataRowView)this.m_dtgEditor.Rows[e.RowIndex - 1].DataBoundItem).Row;
                 if (row[name] != DBNull.Value)
                 {
                     double dblCV = Convert.ToDouble(row[name]);
                     row = ((DataRowView)this.m_dtgEditor.Rows[e.RowIndex - 2].DataBoundItem).Row;
                     if (row[name] != DBNull.Value)
                     {
                         double dblSD = Convert.ToDouble(row[name]);
                         row = ((DataRowView)this.m_dtgEditor.Rows[e.RowIndex - 3].DataBoundItem).Row;
                         if (row[name] != DBNull.Value)
                         {
                             double dblAVG = Convert.ToDouble(row[name]);
                             if (MessageBox.Show("是否刷新当前浓度!", "质控管理", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
                             {
                                 int num = 0;
                                 int.TryParse(name, out num);
                                 List <clsLisQCConcentrationVO> concentrations = this.m_objBatch.GetConcentrations(num);
                                 if (concentrations != null && concentrations.Count > 0)
                                 {
                                     clsLisQCConcentrationVO clsLisQCConcentrationVO = concentrations[0];
                                     clsLisQCConcentrationVO.m_enmStatus = enmQCStatus.Natrural;
                                     clsLisQCConcentrationVO.m_dblCV     = dblCV;
                                     clsLisQCConcentrationVO.m_dblAVG    = dblAVG;
                                     clsLisQCConcentrationVO.m_dblSD     = dblSD;
                                     long num2 = this.m_objDomain.m_lngUpdateSDXCV(clsLisQCConcentrationVO);
                                     if (num2 > 0L)
                                     {
                                         concentrations[0] = clsLisQCConcentrationVO;
                                         this.m_objBatch.UpdateConcentrations(concentrations, num);
                                         MessageBox.Show("刷新当前浓度成功!", "质控管理", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                     }
                                     else
                                     {
                                         MessageBox.Show("刷新当前浓度失败!", "质控管理", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                     }
                                 }
                                 else
                                 {
                                     MessageBox.Show("刷新当前浓度失败!原因是未设置浓度。", "质控管理", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                                 }
                             }
                         }
                     }
                 }
                 this.m_dtgEditor.CurrentCell = this.m_dtgEditor[e.ColumnIndex, e.RowIndex - 1];
             }
         }
     }
 }
예제 #9
0
 private clsLisQCConcentrationVO[] ConstructVOArr(DataTable dtbResult)
 {
     clsLisQCConcentrationVO[] p_objResultArr = new clsLisQCConcentrationVO[dtbResult.Rows.Count];
     for (int i = 0; i < p_objResultArr.Length; i++)
     {
         p_objResultArr[i] = new clsLisQCConcentrationVO();
         ConstructVO(dtbResult.Rows[i], ref p_objResultArr[i]);
     }
     return(p_objResultArr);
 }
예제 #10
0
        public long m_lngUpdate(clsLisQCConcentrationVO p_objRecord)
        {
            long lngRes = 0;

            try
            {
                lngRes = m_objSvc.m_lngUpdate(m_objPrincipal, p_objRecord);
            }
            catch { lngRes = 0; }
            return(lngRes);
        }
예제 #11
0
파일: clsQCBatchNew.cs 프로젝트: ewin66/HIS
        /// <summary>
        /// 质控批浓度表
        /// </summary>
        /// <returns></returns>
        public List <clsLisQCConcentrationVO> GetConcentrations()
        {
            List <clsLisQCConcentrationVO> concentratrionList = new List <clsLisQCConcentrationVO>();

            foreach (clsLisQCConcentrationVO var in m_objConcentrations)
            {
                clsLisQCConcentrationVO temp = new clsLisQCConcentrationVO();
                var.m_mthCopyTo(temp);
                concentratrionList.Add(temp);
            }
            return(concentratrionList);
        }
예제 #12
0
        public long m_lngFind(int p_intQCBatchSeq, int p_intConcentrationSeq, out clsLisQCConcentrationVO p_objRecord)
        {
            long lngRes = 0;

            p_objRecord = null;
            try
            {
                lngRes = m_objSvc.m_lngFind(m_objPrincipal, p_intQCBatchSeq, p_intConcentrationSeq, out p_objRecord);
            }
            catch { lngRes = 0; }
            return(lngRes);
        }
예제 #13
0
        public long m_lngInsert(clsLisQCConcentrationVO p_objRecord)
        {
            int  intID  = -1;
            long lngRes = 0;

            try
            {
                lngRes = m_objSvc.m_lngInsert(m_objPrincipal, p_objRecord);
            }
            catch { lngRes = 0; }
            return(lngRes);
        }
예제 #14
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;
        }
예제 #15
0
파일: ctlQCChartNew.cs 프로젝트: ewin66/HIS
        private void m_cmdPrint_Click(object sender, EventArgs e)
        {
            clsLisQCConcentrationVO objTemp = null;

            if (m_lstChoiceConcentration != null && m_lstChoiceConcentration.Count == 1)
            {
                objTemp = m_lstChoiceConcentration[0];
            }

            clsQCChartToolStrategy print = new clsQCChartToolStrategy(m_zedChart, this.m_objBatch, objTemp);

            print.m_mthPrintPreview();
        }
예제 #16
0
        public long m_lngFind(System.Security.Principal.IPrincipal p_objPrincipal, int[] p_intQCBatchSeqArr,
                              out clsLisQCConcentrationVO[] p_objResultArr)
        {
            long lngRes = 0;

            p_objResultArr = null;
            clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService();

            lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, m_strCurrentSvcDetailName, "m_lngFind");
            if (lngRes <= 0)
            {
                return(-1);
            }
            com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService();
            try
            {
                string strSQL = m_strFindSqlByBatchSeq;

                for (int index = 1; index < p_intQCBatchSeqArr.Length; index++)
                {
                    strSQL += "    or t1.qcbatch_seq_int = ?";
                }

                IDataParameter[] objDPArr = null;
                objHRPSvc.CreateDatabaseParameter(p_intQCBatchSeqArr.Length, out objDPArr);
                for (int index = 0; index < p_intQCBatchSeqArr.Length; index++)
                {
                    objDPArr[index].Value = p_intQCBatchSeqArr[index];
                }

                DataTable dtbResult = null;
                lngRes = 0;
                lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objDPArr);
                objHRPSvc.Dispose();
                if (lngRes == 1 && dtbResult != null && dtbResult.Rows.Count > 0)
                {
                    p_objResultArr = new clsLisQCConcentrationVO[dtbResult.Rows.Count];
                    for (int i = 0; i < p_objResultArr.Length; i++)
                    {
                        p_objResultArr[i] = new clsLisQCConcentrationVO();
                        ConstructVO(dtbResult.Rows[i], ref p_objResultArr[i]);
                        p_objResultArr[i].m_strConcentration = dtbResult.Rows[i]["concentration_vchr"].ToString();
                    }
                }
            }
            catch (Exception objEx)
            {
                new clsLogText().LogError(objEx);
            }
            return(lngRes);
        }
예제 #17
0
 private System.Data.IDataParameter[] GetUpdateDataParameterArr(clsLisQCConcentrationVO p_objQCConcentration)
 {
     System.Data.IDataParameter[] objODPArr = null;
     objODPArr = clsPublicSvc.m_objConstructIDataParameterArr(
         p_objQCConcentration.m_strDeviceSampleId,
         (int)p_objQCConcentration.m_enmStatus,
         DBAssist.ToObject(p_objQCConcentration.m_dblAVG),
         DBAssist.ToObject(p_objQCConcentration.m_dblSD),
         DBAssist.ToObject(p_objQCConcentration.m_dblCV),
         p_objQCConcentration.m_intQCBatchSeq,
         p_objQCConcentration.m_intConcentrationSeq
         );
     return(objODPArr);
 }
예제 #18
0
파일: clsQCBatchNew.cs 프로젝트: ewin66/HIS
        /// <summary>
        /// 质控批浓度表
        /// </summary>
        /// <returns></returns>
        public List <clsLisQCConcentrationVO> GetConcentrations(int p_intBatchSeq)
        {
            List <clsLisQCConcentrationVO> concentratrionList = new List <clsLisQCConcentrationVO>();

            foreach (clsLisQCConcentrationVO var in m_objConcentrations)
            {
                if (var.m_intQCBatchSeq == p_intBatchSeq)
                {
                    clsLisQCConcentrationVO temp = new clsLisQCConcentrationVO();
                    var.m_mthCopyTo(temp);
                    concentratrionList.Add(temp);
                }
            }
            return(concentratrionList);
        }
예제 #19
0
        public void UpdateConcentrations(List <clsLisQCConcentrationVO> p_objConcentrations)
        {
            if (this.IsNull)
            {
                return;
            }
            if (p_objConcentrations != null)
            {
                this.m_objConcentrations.Clear();
                this.m_strBrokenRules = string.Empty;

                foreach (clsLisQCConcentrationVO var in p_objConcentrations)
                {
                    clsLisQCConcentrationVO temp = new clsLisQCConcentrationVO();
                    var.m_mthCopyTo(temp);
                    this.m_objConcentrations.Add(temp);
                }

                clsLisQCDataVO[] objDatas = null;

                long lngRes = 0;

                lngRes = clsTmdQCDataSmp.s_object.m_lngFind(out objDatas, this.Seq, this.m_datBegin, m_datEnd);

                if (lngRes > 0)
                {
                    this.m_objDatas.Clear();

                    if (objDatas != null)
                    {
                        this.m_objDatas.AddRange(objDatas);
                    }
                }
                else
                {
                    if (this.LoadFailed != null)
                    {
                        LoadFailed(this, new DataLoadFailedEventArgs("读取数据失败."));
                    }
                }
                if (this.ConcentrationChanged != null)
                {
                    ConcentrationChanged(this, null);
                }
            }
        }
예제 #20
0
        //列表选定项变更
        private void m_lsvConcentration_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.m_lsvConcentration.SelectedItems.Count <= 0)
            {
                return;
            }
            //变更状态标志
            this.m_blnNew = false;

            clsLisQCConcentrationVO obj = (clsLisQCConcentrationVO)this.m_lsvConcentration.SelectedItems[0].Tag;

            this.m_cboConcentration.Value = obj.m_intConcentrationSeq;
            this.m_txtDeviceSampleID.Text = obj.m_strDeviceSampleId;
            this.m_txtCV.Text             = DBAssist.ToString(obj.m_dblCV);
            this.m_txtSD.Text             = DBAssist.ToString(obj.m_dblSD);
            this.m_txtX.Text = DBAssist.ToString(obj.m_dblAVG);
            if (obj.m_enmStatus == enmQCStatus.Natrural)
            {
                this.m_cboConcentration.Enabled  = false;
                this.m_txtDeviceSampleID.Enabled = true;
                this.m_txtCV.Enabled             = true;
                this.m_txtSD.Enabled             = true;
                this.m_txtX.Enabled = true;

                this.m_cmdNew.Enabled          = true;
                this.m_cmdDelete.Enabled       = true;
                this.m_cmdSave.Enabled         = true;
                this.m_cmdReturn.Enabled       = true;
                this.m_cmdCancelDelete.Enabled = false;
            }
            else
            {
                this.m_cboConcentration.Enabled  = false;
                this.m_txtDeviceSampleID.Enabled = false;
                this.m_txtCV.Enabled             = false;
                this.m_txtSD.Enabled             = false;
                this.m_txtX.Enabled = false;

                this.m_cmdNew.Enabled          = true;
                this.m_cmdDelete.Enabled       = false;
                this.m_cmdSave.Enabled         = false;
                this.m_cmdReturn.Enabled       = true;
                this.m_cmdCancelDelete.Enabled = true;
            }
        }
예제 #21
0
        private System.Data.IDataParameter[] GetInsertDataParameterArr(clsLisQCConcentrationVO p_objQCConcentration)
        {
            //    QCBATCH_SEQ_INT, CONCENTRATION_SEQ_INT,
            //    DEVICESAMPLE_ID_VCHR, STATUS_INT, AVG_NUM, SD_NUM, CV_NUM

            System.Data.IDataParameter[] objODPArr = null;
            objODPArr = clsPublicSvc.m_objConstructIDataParameterArr(
                p_objQCConcentration.m_intQCBatchSeq,
                p_objQCConcentration.m_intConcentrationSeq,
                p_objQCConcentration.m_strDeviceSampleId,
                (int)p_objQCConcentration.m_enmStatus,
                DBAssist.ToObject(p_objQCConcentration.m_dblAVG),
                DBAssist.ToObject(p_objQCConcentration.m_dblSD),
                DBAssist.ToObject(p_objQCConcentration.m_dblCV)

                );
            return(objODPArr);
        }
예제 #22
0
 public void ConstructVO(DataRow p_dtrSource, ref clsLisQCConcentrationVO p_objQCConcentration)
 {
     //    QCBATCH_SEQ_INT, CONCENTRATION_SEQ_INT,
     //    DEVICESAMPLE_ID_VCHR, STATUS_INT, AVG_NUM, SD_NUM, CV_NUM
     p_objQCConcentration.m_intConcentrationSeq = DBAssist.ToInt32(p_dtrSource["CONCENTRATION_SEQ_INT"]);
     p_objQCConcentration.m_intQCBatchSeq       = DBAssist.ToInt32(p_dtrSource["QCBATCH_SEQ_INT"]);
     p_objQCConcentration.m_strDeviceSampleId   = p_dtrSource["DEVICESAMPLE_ID_VCHR"].ToString();
     try
     {
         p_objQCConcentration.m_enmStatus = (enmQCStatus)DBAssist.ToInt32(p_dtrSource["STATUS_INT"]);
     }
     catch
     {
     }
     p_objQCConcentration.m_dblAVG = DBAssist.ToDouble(p_dtrSource["AVG_NUM"]);
     p_objQCConcentration.m_dblSD  = DBAssist.ToDouble(p_dtrSource["SD_NUM"]);
     p_objQCConcentration.m_dblCV  = DBAssist.ToDouble(p_dtrSource["CV_NUM"]);
 }
예제 #23
0
파일: ctlQCChartNew.cs 프로젝트: ewin66/HIS
        private void AddZLineItems()
        {
            List <clsLisQCDataVO> QCDataList = m_lstDataListByConcentration();

            //List<clsLisQCDataVO>[] arrQCDataList = m_lstDataListByConcentration();
            PointPairList[] arrPointPair = new PointPairList[m_lstChoiceConcentration.Count];

            for (int i = 0; i < m_lstChoiceConcentration.Count; i++)
            {
                clsLisQCConcentrationVO con = m_lstChoiceConcentration[i];
                double X  = con.m_dblAVG;
                double SD = con.m_dblSD;
                if (SD == 0)
                {
                    SD = double.MaxValue;
                }
                PointPairList pointsPair = new PointPairList();
                foreach (clsLisQCDataVO vo in QCDataList)
                {
                    double x = (double)XDate.DateTimeToXLDate(vo.m_datQCDate);
                    double y = (vo.m_dlbResult - X) / SD;
                    pointsPair.Add(x, y);
                }
                arrPointPair[i] = pointsPair;
            }

            Color[] colors = new Color[] { Color.Red, Color.Green, Color.Purple, Color.RosyBrown, Color.Yellow, Color.Blue, Color.Black, Color.Brown };

            for (int i = 0; i < arrPointPair.Length; i++)
            {
                Color color;
                if (i < colors.Length)
                {
                    color = colors[i];
                }
                else
                {
                    color = Color.Red;
                }

                LineItem itemCurve = m_zedChart.GraphPane.AddCurve(m_lstChoiceConcentration[i].m_strConcentration, arrPointPair[i], color, SymbolType.Diamond);
                itemCurve.Symbol.Fill = new Fill(Color.White);
            }
        }
예제 #24
0
파일: clsQCBatchNew.cs 프로젝트: ewin66/HIS
        /// <summary>
        /// 浓度改变
        /// </summary>
        /// <param name="p_objConcentrations"></param>
        public void UpdateConcentrations(List <clsLisQCConcentrationVO> p_objConcentrations)
        {
            if (this.IsNull)
            {
                return;
            }
            if (p_objConcentrations != null)
            {
                this.m_objConcentrations.Clear();
                this.m_strBrokenRules = string.Empty;

                foreach (clsLisQCConcentrationVO var in p_objConcentrations)
                {
                    clsLisQCConcentrationVO temp = new clsLisQCConcentrationVO();
                    var.m_mthCopyTo(temp);
                    this.m_objConcentrations.Add(temp);
                }

                if (this.ConcentrationChanged != null)
                {
                    ConcentrationChanged(this, null);
                }
            }
        }
예제 #25
0
        /// <summary>
        /// DataTable数据
        /// </summary>
        private void m_mthFillDataTable()
        {
            List <clsQCDataPairItem> lstDataPair = clsQCDataPairItem.GetQCDataPairItemList(m_lstWorkedData);

            m_dtbSource.Rows.Clear();
            List <int> seqArr   = new List <int>();
            DateTime   dteBegin = m_objBatch.DateBegin;
            DateTime   dteEnd;

            while (true)
            {
                dteEnd = this.m_objBatch.DateEnd;

                if (!(dteBegin <= dteEnd.Date))
                {
                    break;
                }

                DataRow dataRow = this.m_dtbSource.NewRow();
                dataRow["date"]    = dteBegin.Date;
                dataRow["strdate"] = dteBegin.Date.ToString("yyyy-MM-dd");

                foreach (clsQCDataPairItem pair in lstDataPair)
                {
                    dteEnd = pair.QCDate;
                    if (dteEnd.Date == dteBegin.Date)
                    {
                        seqArr.Add(this.m_objBatch.SeqArr[0]);
                        seqArr.Add(Convert.ToInt16(this.m_objBatch.SeqArr[0].ToString() + "1"));
                        seqArr.Add(Convert.ToInt16(this.m_objBatch.SeqArr[0].ToString() + "2"));

                        for (int i = 0; i < seqArr.Count; i++)
                        {
                            int p_intBatchSeq = seqArr[i];

                            if (pair[p_intBatchSeq] != null)
                            {
                                dataRow[p_intBatchSeq.ToString()]         = pair[p_intBatchSeq].m_dlbResult;
                                dataRow[p_intBatchSeq.ToString() + "obj"] = pair[p_intBatchSeq];
                            }
                        }
                    }
                }
                this.m_dtbSource.Rows.Add(dataRow);
                dteBegin = dteBegin.AddDays(1.0);
            }

            dteEnd   = this.m_objBatch.DateEnd;
            dteBegin = dteEnd.Date;


            DataRow dataRow2 = this.m_dtbSource.NewRow();

            dataRow2["date"]    = dteBegin.AddHours(20.0);
            dataRow2["strdate"] = this.m_strLocalX;
            this.m_dtbSource.Rows.Add(dataRow2);
            DataRow dataRow3 = this.m_dtbSource.NewRow();

            dataRow3["date"]    = dteBegin.AddHours(21.0);
            dataRow3["strdate"] = this.m_strLocalSD;
            this.m_dtbSource.Rows.Add(dataRow3);
            DataRow dataRow4 = this.m_dtbSource.NewRow();

            dataRow4["date"]    = dteBegin.AddHours(22.0);
            dataRow4["strdate"] = this.m_strLocalCV;
            this.m_dtbSource.Rows.Add(dataRow4);
            DataRow dataRow5 = this.m_dtbSource.NewRow();

            dataRow5["date"]    = dteBegin.AddHours(23.0);
            dataRow5["strdate"] = this.m_strLocalConn;
            this.m_dtbSource.Rows.Add(dataRow5);

            List <double>           list = null;
            clsLisQCConcentrationVO clsLisQCConcentrationVO = null;

            seqArr.Clear();
            seqArr.Add(this.m_objBatch.SeqArr[0]);
            seqArr.Add(Convert.ToInt16(this.m_objBatch.SeqArr[0].ToString() + "1"));
            seqArr.Add(Convert.ToInt16(this.m_objBatch.SeqArr[0].ToString() + "2"));
            for (int i = 0; i < seqArr.Count; i++)
            {
                int p_intBatchSeq = seqArr[i];
                dataRow5[p_intBatchSeq.ToString()] = this.m_strFlashConn;
                list = this.m_objBatch.m_mthGetDatas(p_intBatchSeq);
                if (list != null && list.Count > 0)
                {
                    List <clsLisQCConcentrationVO> concentrations = this.m_objBatch.GetConcentrations(p_intBatchSeq);
                    if (concentrations != null && concentrations.Count > 0)
                    {
                        clsLisQCConcentrationVO = concentrations[0];
                    }
                    if (clsLisQCConcentrationVO != null)
                    {
                        this.m_mthDataFilter(clsLisQCConcentrationVO.m_dblAVG, clsLisQCConcentrationVO.m_dblSD, ref list);
                    }
                    double num;
                    double num2;
                    double num3;
                    clsLISPublic.m_lngCalculateSDXCV(list.ToArray(), out num, out num2, out num3);
                    dataRow2[p_intBatchSeq.ToString()] = num.ToString("0.00");
                    dataRow3[p_intBatchSeq.ToString()] = num2.ToString("0.000");
                    dataRow4[p_intBatchSeq.ToString()] = num3.ToString("0.00");
                }
            }
            this.m_dtbSource.AcceptChanges();
        }
예제 #26
0
        //保存
        private void m_cmdSave_Click(object sender, EventArgs e)
        {
            if (this.m_lsvConcentration.SelectedItems.Count <= 0 &&
                !this.m_blnNew)
            {
                return;
            }

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

            if (this.m_blnNew)
            {//新增的保存
                if (this.m_blnNewCheck())
                {
                    clsLisQCConcentrationVO objQCConcentration = new clsLisQCConcentrationVO();
                    objQCConcentration.m_enmStatus           = enmQCStatus.Natrural;
                    objQCConcentration.m_intConcentrationSeq = m_cboConcentration.Value;
                    objQCConcentration.m_intQCBatchSeq       = m_intQCBatchSeq;
                    objQCConcentration.m_strConcentration    = m_cboConcentration.Text;
                    objQCConcentration.m_strDeviceSampleId   = m_txtDeviceSampleID.Text.Trim();
                    try { objQCConcentration.m_dblAVG = Convert.ToDouble(m_txtX.Text.Trim()); }
                    catch { objQCConcentration.m_dblAVG = DBAssist.NullDouble; }
                    try { objQCConcentration.m_dblSD = Convert.ToDouble(m_txtSD.Text.Trim()); }
                    catch { objQCConcentration.m_dblSD = DBAssist.NullDouble; }

                    try { objQCConcentration.m_dblCV = Convert.ToDouble(m_txtCV.Text.Trim()); }
                    catch { objQCConcentration.m_dblCV = DBAssist.NullDouble; }

                    long lngRes = clsTmdQCBatchConcentrationSmp.s_object.m_lngInsert(objQCConcentration);

                    if (lngRes > 0)
                    {//成功
                        //更新状态标志
                        this.m_blnNew = false;
                        //加入到集合
                        this.m_objQCContrations.Add(objQCConcentration);
                        //添加新项
                        ListViewItem item = new ListViewItem(objQCConcentration.m_intConcentrationSeq.ToString());
                        item.SubItems.Add(objQCConcentration.m_strConcentration);
                        item.SubItems.Add(objQCConcentration.m_strDeviceSampleId);
                        item.SubItems.Add(DBAssist.ToString(objQCConcentration.m_dblAVG));
                        item.SubItems.Add(DBAssist.ToString(objQCConcentration.m_dblSD));
                        item.SubItems.Add(DBAssist.ToString(objQCConcentration.m_dblCV));
                        item.SubItems.Add("");
                        item.Tag = objQCConcentration;
                        this.m_lsvConcentration.Items.Add(item);
                        this.m_lsvConcentration.Focus();
                        item.Selected = true;
                        item.Focused  = true;
                    }
                    else
                    {//失败
                        clsCommonDialog.m_mthShowDBError();
                    }
                }
            }
            else if (this.m_blnModifyCheck())
            {//修改的保存
                clsLisQCConcentrationVO objConcentration = (clsLisQCConcentrationVO)this.m_lsvConcentration.SelectedItems[0].Tag;

                clsLisQCConcentrationVO objTemp = new clsLisQCConcentrationVO();
                objConcentration.m_mthCopyTo(objTemp);
                objTemp.m_strDeviceSampleId = this.m_txtDeviceSampleID.Text.Trim();
                try { objTemp.m_dblAVG = Convert.ToDouble(m_txtX.Text.Trim()); }
                catch { objTemp.m_dblAVG = DBAssist.NullDouble; }
                try { objTemp.m_dblSD = Convert.ToDouble(m_txtSD.Text.Trim()); }
                catch { objTemp.m_dblSD = DBAssist.NullDouble; }

                try { objTemp.m_dblCV = Convert.ToDouble(m_txtCV.Text.Trim()); }
                catch { objTemp.m_dblCV = DBAssist.NullDouble; }

                long lngRes = clsTmdQCBatchConcentrationSmp.s_object.m_lngUpdate(objTemp);

                if (lngRes > 0)
                {//成功
                    objTemp.m_mthCopyTo(objConcentration);
                    this.m_lsvConcentration.SelectedItems[0].SubItems[2].Text = objConcentration.m_strDeviceSampleId;
                    this.m_lsvConcentration.SelectedItems[0].SubItems[3].Text = DBAssist.ToString(objConcentration.m_dblAVG);
                    this.m_lsvConcentration.SelectedItems[0].SubItems[4].Text = DBAssist.ToString(objConcentration.m_dblSD);
                    this.m_lsvConcentration.SelectedItems[0].SubItems[5].Text = DBAssist.ToString(objConcentration.m_dblCV);
                }
                else
                {//失败
                    clsCommonDialog.m_mthShowDBError();
                }
            }
            this.m_cmdSave.Enabled = true;
            Cursor.Current         = Cursors.Default;
        }
예제 #27
0
파일: frmQCSetup.cs 프로젝트: ewin66/HIS
 private void cmdSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.txtSeq.Text))
     {
         MessageBox.Show("请选择一个质控项目!");
     }
     else
     {
         this.idConcentration     = this.cboConcentration.SelectedIndex;
         this.m_strDeviceSampleID = this.txtCode.Text;
         Cursor.Current           = Cursors.WaitCursor;
         if (this.txtSortNum.Text == "")
         {
             MessageBox.Show("排序号没填!");
             this.txtSortNum.Focus();
         }
         else
         {
             if (string.IsNullOrEmpty(this.cboConcentration.Text) || this.cboConcentration.Value < 0)
             {
                 MessageBox.Show("浓度没填!");
                 this.cboConcentration.Focus();
             }
             else
             {
                 if (this.txtBValue.Text.Trim() != string.Empty)
                 {
                     double num;
                     if (!double.TryParse(this.txtBValue.Text.Trim(), out num))
                     {
                         MessageBox.Show("请输入数字!", this.lblBValue.Text);
                         this.txtBValue.Focus();
                         this.txtBValue.SelectAll();
                         return;
                     }
                 }
                 if (this.txtSD.Text.Trim() != string.Empty)
                 {
                     double num;
                     if (!double.TryParse(this.txtSD.Text.Trim(), out num))
                     {
                         MessageBox.Show("请输入数字!", this.lblCV.Text);
                         this.txtSD.Focus();
                         this.txtSD.SelectAll();
                         return;
                     }
                 }
                 if (this.txtCV.Text.Trim() != string.Empty)
                 {
                     double num;
                     if (!double.TryParse(this.txtCV.Text.Trim(), out num))
                     {
                         MessageBox.Show("请输入数字!", this.lblCV.Text);
                         this.txtCV.Focus();
                         this.txtCV.SelectAll();
                         return;
                     }
                 }
                 int num2 = 0;
                 int.TryParse(this.txtSeq.Text, out num2);
                 int num3 = -1;
                 for (int i = 0; i < this.m_objBatchSets.Count; i++)
                 {
                     if (this.m_objBatchSets[i].m_intSeq == num2)
                     {
                         num3 = i;
                         break;
                     }
                 }
                 if (num3 < 0)
                 {
                     MessageBox.Show("没有找到与之相对应的质控批!");
                     Cursor.Current = Cursors.Default;
                 }
                 else
                 {
                     this.m_objBatchSets[num3].m_intSeq             = int.Parse(this.txtSeq.Text.ToString().Trim());
                     this.m_objBatchSets[num3].m_strDeviceId        = this.cboApparatusType.SelectedValue.ToString().Trim();
                     this.m_objBatchSets[num3].m_strCheckItemName   = this.txtItems.Text.ToString().Trim();
                     this.m_objBatchSets[num3].m_strSampleLotNo     = this.txtGroupNum.Text.ToString().Trim();
                     this.m_objBatchSets[num3].m_strSampleSource    = this.cboManOrigin.Text.ToString().Trim();
                     this.m_objBatchSets[num3].m_strCheckmethodName = this.cboExamineMethod.Text.ToString().Trim();
                     double dblWaveLength = 0.0;
                     double.TryParse(this.txtWaveLength.Text.ToString(), out dblWaveLength);
                     this.m_objBatchSets[num3].m_dblWaveLength  = dblWaveLength;
                     this.m_objBatchSets[num3].m_strResultUnit  = this.txtUnit.Text.ToString().Trim();
                     this.m_objBatchSets[num3].m_dtBegin        = this.dtpBegindate.Value;
                     this.m_objBatchSets[num3].m_dtEnd          = this.dtpEnddate.Value;
                     this.m_objBatchSets[num3].m_strSortNum     = this.txtSortNum.Text.ToString().Trim();
                     this.m_objBatchSets[num3].m_strCheckItemId = this.m_txtCheckItemsID.Text.ToString();
                     this.m_objBatchSets[num3].m_strDeviceId    = this.m_txtDeviceId.Text.ToString();
                     num3 = -1;
                     for (int i = 0; i < this.m_objConcentrations.Count; i++)
                     {
                         if (this.m_objConcentrations[i].m_intQCBatchSeq == num2)
                         {
                             num3 = i;
                             break;
                         }
                     }
                     if (num3 < 0)
                     {
                         this.objConcentrations = new clsLisQCConcentrationVO();
                         this.m_objConcentrations.Add(this.objConcentrations);
                     }
                     else
                     {
                         this.objConcentrations = this.m_objConcentrations[num3];
                     }
                     this.objConcentrations.m_intQCBatchSeq    = num2;
                     this.objConcentrations.m_strConcentration = this.cboConcentration.Text.ToString().Trim();
                     if (!string.IsNullOrEmpty(this.objConcentrations.m_strConcentration))
                     {
                         this.objConcentrations.m_intConcentrationSeq = this.cboConcentration.Value;
                     }
                     this.objConcentrations.m_strDeviceSampleId = this.txtCode.Text.ToString().Trim();
                     double num4 = 0.0;
                     double.TryParse(this.txtBValue.Text.ToString(), out num4);
                     this.objConcentrations.m_dblAVG = num4;
                     double.TryParse(this.txtSD.Text.ToString(), out num4);
                     this.objConcentrations.m_dblSD = num4;
                     double.TryParse(this.txtCV.Text.ToString(), out num4);
                     this.objConcentrations.m_dblCV = num4;
                     this.CreateDataTable(this.m_objBatchSets, this.m_objConcentrations);
                     this.m_mthReset();
                     Cursor.Current = Cursors.Default;
                 }
             }
         }
     }
 }
예제 #28
0
 public clsQCChartToolStrategy(ZedGraphControl p_zedChart, clsQCBatchNew p_objBatchInfo, clsLisQCConcentrationVO p_objQCCon)
     : this()
 {
     m_objChartInfo.zedChart       = p_zedChart;
     m_objChartInfo.objBatch       = p_objBatchInfo;
     m_objChartInfo.objSelectQCCon = p_objQCCon;
 }