示例#1
0
        public static string GetUpdateBgdcXCGSql(DataTable dttv, xuechangguiBean xcg)
        {
            int    flag = Common.JudgeValueForXCG(dttv, xcg);
            String sql  = "update zkhw_tj_bgdc set XueChangGui='" + flag + "' where aichive_no = '" + xcg.aichive_no + "' and bar_code='" + xcg.bar_code + "'";

            return(sql);
        }
示例#2
0
        public static string GetSqlForXCG(xuechangguiBean xcg)
        {
            string sql1 = "select count(id) from zkhw_tj_xcg where timeCodeUnique='" + xcg.timeCodeUnique + "'";
            bool   flag = DbHelperMySQL.Exists(sql1);
            string sql  = "";

            if (flag == false)
            {
                string id = Result.GetNewId();
                sql = @"insert into zkhw_tj_xcg(ID,aichive_no,id_number,bar_code,HCT,HGB,LYM,LYMP,MCH,MCHC,
                        MCV,MPV,MXD,MXDP,NEUT,NEUTP,PCT,PDW,PLT,RBC,RDWCV,RDWSD,WBC,MONO,MONOP,GRAN,GRANP,
                        PLCR,createtime,ZrysXCG,timeCodeUnique) values('" + id + "','" + xcg.aichive_no +
                      "','" + xcg.id_number + "','" + xcg.bar_code + "','" + xcg.HCT + "','" + xcg.HGB +
                      "','" + xcg.LYM + "','" + xcg.LYMP + "','" + xcg.MCH + "','" + xcg.MCHC + "','" +
                      xcg.MCV + "','" + xcg.MPV + "','" + xcg.MXD + "','" + xcg.MXDP + "','" + xcg.NEUT +
                      "','" + xcg.NEUTP + "','" + xcg.PCT + "','" + xcg.PDW + "','" + xcg.PLT + "','" +
                      xcg.RBC + "','" + xcg.RDW_CV + "','" + xcg.RDW_SD + "','" + xcg.WBC + "','" +
                      xcg.MONO + "','" + xcg.MONOP + "','" + xcg.GRAN + "','" + xcg.GRANP + "','" +
                      xcg.PLCR + "','" + xcg.createTime + "','" + xcg.ZrysXCG + "','" + xcg.timeCodeUnique + "')";
            }
            else
            {
                sql = @"update zkhw_tj_xcg set HCT='" + xcg.HCT + "',HGB='" + xcg.HGB + "',LYM='" + xcg.LYM +
                      "',LYMP='" + xcg.LYMP + "',MCH='" + xcg.MCH + "',MCHC='" + xcg.MCHC + "',MCV='" + xcg.MCV
                      + "',MPV='" + xcg.MPV + "',MXD='" + xcg.MXD + "',MXDP='" + xcg.MXDP + "',NEUT='" +
                      xcg.NEUT + "',NEUTP='" + xcg.NEUTP + "',PCT='" + xcg.PCT + "',PDW='" + xcg.PDW +
                      "',PLT='" + xcg.PLT + "',RBC='" + xcg.RBC + "',RDWCV='" + xcg.RDW_CV + "',RDWSD='" +
                      xcg.RDW_SD + "',WBC='" + xcg.WBC + "',MONO='" + xcg.MONO + "',MONOP='" + xcg.MONOP +
                      "',GRAN='" + xcg.GRAN + "',GRANP='" + xcg.GRANP + "',PLCR='" + xcg.PLCR +
                      "',upload_status=0 where timeCodeUnique = '" + xcg.timeCodeUnique + "'";
            }
            return(sql);
        }
示例#3
0
        public static xuechangguiBean GetXCGObj(string ZrysSH, DataRow dr, out string xcgid)
        {
            xcgid = dr["ID"].ToString();
            xuechangguiBean obj = new xuechangguiBean();

            try
            {
                obj.ZrysXCG  = ZrysSH;
                obj.bar_code = dr["bar_code"].ToString();
                DataTable dtjkinfo = jkdao.selectjkInfoBybarcode(obj.bar_code);
                if (dtjkinfo != null && dtjkinfo.Rows.Count > 0)
                {
                    obj.aichive_no = dtjkinfo.Rows[0]["aichive_no"].ToString();
                    obj.id_number  = dtjkinfo.Rows[0]["id_number"].ToString();
                }
                else
                {
                    return(null);
                }
                obj.HCT            = dr["HCT"].ToString();
                obj.HGB            = dr["HGB"].ToString();
                obj.LYM            = dr["LYM"].ToString();
                obj.LYMP           = dr["LYMP"].ToString();
                obj.MCH            = dr["MCH"].ToString();
                obj.MCHC           = dr["MCHC"].ToString();
                obj.MCV            = dr["MCV"].ToString();
                obj.MPV            = dr["MPV"].ToString();
                obj.MXD            = dr["MXD"].ToString();
                obj.MXDP           = dr["MXDP"].ToString();
                obj.NEUT           = dr["NEUT"].ToString();
                obj.NEUTP          = dr["NEUTP"].ToString();
                obj.PCT            = dr["PCT"].ToString();
                obj.PDW            = dr["PDW"].ToString();
                obj.PLT            = dr["PLT"].ToString();
                obj.RBC            = dr["RBC"].ToString();
                obj.RDW_CV         = dr["RDWCV"].ToString();
                obj.RDW_SD         = dr["RDWSD"].ToString();
                obj.WBC            = dr["WBC"].ToString();
                obj.MONO           = dr["MONO"].ToString();
                obj.MONOP          = dr["MONOP"].ToString();
                obj.GRAN           = dr["GRAN"].ToString();
                obj.GRANP          = dr["GRANP"].ToString();
                obj.PLCR           = dr["PLCR"].ToString();
                obj.createTime     = dr["createtime"].ToString();
                obj.timeCodeUnique = dr["timecodeUnique"].ToString();
                if (dr["deviceModel"].ToString() == "")
                {
                    obj.deviceModel = "XCG_YNH_001";
                }
                else
                {
                    obj.deviceModel = dr["deviceModel"].ToString();
                }
            }
            catch (Exception dd)
            {
            }

            return(obj);
        }
示例#4
0
        public bool updateXuechangguiInfo(xuechangguiBean xcg)
        {
            int    rt  = 0;
            String sql = "update zkhw_tj_xcg set HCT='" + xcg.HCT + "',HGB='" + xcg.HGB + "',LYM='" + xcg.LYM + "',LYMP='" + xcg.LYMP + "',MCH='" + xcg.MCH + "',MCHC='" + xcg.MCHC + "',MCV='" + xcg.MCV + "',MPV='" + xcg.MPV + "',MXD='" + xcg.MXD + "',MXDP='" + xcg.MXDP + "',NEUT='" + xcg.NEUT + "',NEUTP='" + xcg.NEUTP + "',PCT='" + xcg.PCT + "',PDW='" + xcg.PDW + "',PLT='" + xcg.PLT + "',RBC='" + xcg.RBC + "',RDWCV='" + xcg.RDW_CV + "',RDWSD='" + xcg.RDW_SD + "',WBC='" + xcg.WBC + "',MONO='" + xcg.MONO + "',MONOP='" + xcg.MONOP + "',GRAN='" + xcg.GRAN + "',GRANP='" + xcg.GRANP + "',PLCR='" + xcg.PLCR + "',upload_status=0,deviceModel='" + xcg.deviceModel + "' where aichive_no = '" + xcg.aichive_no + "' and bar_code='" + xcg.bar_code + "'";

            rt = DbHelperMySQL.ExecuteSql(sql);
            return(rt == 0 ? false : true);
        }
示例#5
0
        public static string GetUpdatePEXCGInfoSql(xuechangguiBean xcg)
        {
            String sql = @"update physical_examination_record set blood_hemoglobin='" + xcg.HGB +
                         "',blood_leukocyte='" + xcg.WBC + "',blood_platelet='" + xcg.PLT +
                         "' where aichive_no = '" + xcg.aichive_no + "' and bar_code='" + xcg.bar_code + "'";

            return(sql);
        }
示例#6
0
        public bool insertXuechangguiInfo(xuechangguiBean xcg)
        {
            int    rt             = 0;
            string id             = Result.GetNewId();
            string timeCodeUnique = xcg.bar_code + "_" + xcg.createTime;
            String sql            = "insert into zkhw_tj_xcg(ID,aichive_no,id_number,bar_code,HCT,HGB,LYM,LYMP,MCH,MCHC,MCV,MPV,MXD,MXDP,NEUT,NEUTP,PCT,PDW,PLT,RBC,RDWCV,RDWSD,WBC,MONO,MONOP,GRAN,GRANP,PLCR,createtime,ZrysXCG,timeCodeUnique,deviceModel) values('" + id + "','" + xcg.aichive_no + "','" + xcg.id_number + "','" + xcg.bar_code + "','" + xcg.HCT + "','" + xcg.HGB + "','" + xcg.LYM + "','" + xcg.LYMP + "','" + xcg.MCH + "','" + xcg.MCHC + "','" + xcg.MCV + "','" + xcg.MPV + "','" + xcg.MXD + "','" + xcg.MXDP + "','" + xcg.NEUT + "','" + xcg.NEUTP + "','" + xcg.PCT + "','" + xcg.PDW + "','" + xcg.PLT + "','" + xcg.RBC + "','" + xcg.RDW_CV + "','" + xcg.RDW_SD + "','" + xcg.WBC + "','" + xcg.MONO + "','" + xcg.MONOP + "','" + xcg.GRAN + "','" + xcg.GRANP + "','" + xcg.PLCR + "','" + xcg.createTime + "','" + xcg.ZrysXCG + "','" + timeCodeUnique + "','" + xcg.deviceModel + "')";

            rt = DbHelperMySQL.ExecuteSql(sql);
            return(rt == 0 ? false : true);
        }
示例#7
0
        private void button5_Click(object sender, EventArgs e)
        {
            string WBC    = this.textBox5.Text;
            string RBC    = this.textBox6.Text;
            string PCT    = this.textBox8.Text;
            string PLT    = this.textBox7.Text;
            string HGB    = this.textBox11.Text;
            string HCT    = this.textBox10.Text;
            string MCV    = this.textBox13.Text;
            string MCH    = this.textBox12.Text;
            string MCHC   = this.textBox15.Text;
            string RDWCV  = this.textBox14.Text;
            string RDWSD  = this.textBox17.Text;
            string MONO   = this.textBox16.Text;
            string MONOP  = this.textBox19.Text;
            string GRAN   = this.textBox18.Text;
            string GRANP  = this.textBox21.Text;
            string NEUT   = this.textBox20.Text;
            string NEUTP  = this.textBox23.Text;
            string EO     = this.textBox22.Text;
            string EOP    = this.textBox25.Text;
            string BASO   = this.textBox24.Text;
            string BASOP  = this.textBox29.Text;
            string LYM    = this.textBox28.Text;
            string LYMP   = this.textBox31.Text;
            string MPV    = this.textBox30.Text;
            string PDW    = this.textBox33.Text;
            string MXD    = this.textBox32.Text;
            string MXDP   = this.textBox35.Text;
            string PLCR   = this.textBox34.Text;
            string OTHERS = this.textBox36.Text;
            //1:判断有没有,有就更新 否则就插入 DataTable selectXuechangguiInfo
            bool istrue = false;

            if (_isHaveData == true)
            {
                istrue = tjdao.updateXuechangguiInfo(aichive_no, bar_code, WBC, RBC, PCT, PLT, HGB, HCT, MCV, MCH, MCHC, RDWCV, RDWSD, MONO, MONOP, GRAN, GRANP, NEUT, NEUTP, EO, EOP, BASO, BASOP, LYM, LYMP, MPV, PDW, MXD, MXDP, PLCR, OTHERS, _currentdevno, setting.basicInfoSettings.xcg);
            }
            else
            {
                string[]        deviceno = Common._deviceModel.Split(',');
                xuechangguiBean obj      = new xuechangguiBean();
                obj.deviceModel = deviceno[1].ToString().Trim();
                obj.aichive_no  = aichive_no;
                obj.bar_code    = bar_code;
                obj.id_number   = textBox4.Text;
                obj.HCT         = HCT;
                obj.HGB         = HGB;
                obj.LYM         = LYM;
                obj.LYMP        = LYMP;
                obj.MCH         = MCH;
                obj.MCHC        = MCHC;
                obj.MCV         = MCV;
                obj.MPV         = MPV;
                obj.MXD         = MXD;
                obj.MXDP        = MXDP;
                obj.NEUT        = NEUT;
                obj.NEUTP       = NEUTP;
                obj.PCT         = PCT;
                obj.PDW         = PDW;
                obj.PLT         = PLT;
                obj.RBC         = RBC;
                obj.RDWCV       = RDWCV;
                obj.RDWSD       = RDWSD;
                obj.WBC         = WBC;
                obj.MONO        = MONO;
                obj.MONOP       = MONOP;
                obj.GRAN        = GRAN;
                obj.GRANP       = GRANP;
                obj.PLCR        = PLCR;
                obj.createTime  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                obj.ZrysXCG     = setting.basicInfoSettings.xcg;
                //obj.timeCodeUnique = obj.bar_code + "_" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                istrue = tjdao.insertXuechangguiInfo(obj);
            }

            if (istrue)
            {
                #region 处理下数据判断

                int r0 = 1;
                if (WBC != "" && WBC != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(WBC, out a);
                    if (b == true)
                    {
                        r0 = GetJudgeResultForWBC(a);
                    }
                }
                int r1 = 1;
                if (RBC != "" && RBC != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(RBC, out a);
                    if (b == true)
                    {
                        r1 = GetJudgeResultForRBC(a);
                    }
                }
                int r2 = 1;
                if (PCT != "" && PCT != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(PCT, out a);
                    if (b == true)
                    {
                        r2 = GetJudgeResultForPCT(a);
                    }
                }
                int r3 = 1;
                if (PLT != "" && PLT != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(PLT, out a);
                    if (b == true)
                    {
                        r3 = GetJudgeResultForPLT(a);
                    }
                }
                int r4 = 1;
                if (HGB != "" && HGB != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(HGB, out a);
                    if (b == true)
                    {
                        r4 = GetJudgeResultForHGB(a);
                    }
                }
                int r5 = 1;
                if (HCT != "" && HCT != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(HCT, out a);
                    if (b == true)
                    {
                        r5 = GetJudgeResultForHCT(a);
                    }
                }
                int r6 = 1;
                if (MCV != "" && MCV != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(MCV, out a);
                    if (b == true)
                    {
                        r6 = GetJudgeResultForMCV(a);
                    }
                }
                int r7 = 1;
                if (MCH != "" && MCH != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(MCH, out a);
                    if (b == true)
                    {
                        r7 = GetJudgeResultForMCH(a);
                    }
                }
                int r8 = 1;
                if (MCHC != "" && MCHC != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(MCHC, out a);
                    if (b == true)
                    {
                        r8 = GetJudgeResultForMCHC(a);
                    }
                }
                int r9 = 1;
                if (RDWCV != "" && RDWCV != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(RDWCV, out a);
                    if (b == true)
                    {
                        r9 = GetJudgeResultForRDWCV(a);
                    }
                }
                int r10 = 1;
                if (RDWSD != "" && RDWSD != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(RDWSD, out a);
                    if (b == true)
                    {
                        r10 = GetJudgeResultForRDWSD(a);
                    }
                }
                int r11 = 1;
                if (NEUT != "" && NEUT != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(NEUT, out a);
                    if (b == true)
                    {
                        r11 = GetJudgeResultForNEUT(a);
                    }
                }
                int r12 = 1;
                if (NEUTP != "" && NEUTP != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(NEUTP, out a);
                    if (b == true)
                    {
                        r12 = GetJudgeResultForNEUTP(a);
                    }
                }
                int r13 = 1;
                if (LYM != "" && LYM != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(LYM, out a);
                    if (b == true)
                    {
                        r13 = GetJudgeResultForLYM(a);
                    }
                }
                int r14 = 1;
                if (LYMP != "" && LYMP != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(LYMP, out a);
                    if (b == true)
                    {
                        r14 = GetJudgeResultForLYMP(a);
                    }
                }
                int r15 = 1;
                if (MPV != "" && MPV != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(MPV, out a);
                    if (b == true)
                    {
                        r15 = GetJudgeResultForMPV(a);
                    }
                }
                int r16 = 1;
                if (PDW != "" && PDW != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(PDW, out a);
                    if (b == true)
                    {
                        r16 = GetJudgeResultForPDW(a);
                    }
                }
                int r17 = 1;
                if (MXD != "" && MXD != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(MXD, out a);
                    if (b == true)
                    {
                        r17 = GetJudgeResultForMXD(a);
                    }
                }
                int r18 = 1;
                if (MXDP != "" && MXDP != "*")
                {
                    double a = 0;
                    bool   b = double.TryParse(MXDP, out a);
                    if (b == true)
                    {
                        r18 = GetJudgeResultForMXDP(a);
                    }
                }
                int r = 1;
                r = r0;
                if (r < r1)
                {
                    r = r1;
                }
                if (r < r2)
                {
                    r = r2;
                }
                if (r < r3)
                {
                    r = r3;
                }
                if (r < r4)
                {
                    r = r4;
                }
                if (r < r5)
                {
                    r = r5;
                }
                if (r < r6)
                {
                    r = r6;
                }
                if (r < r7)
                {
                    r = r7;
                }
                if (r < r8)
                {
                    r = r8;
                }
                if (r < r9)
                {
                    r = r9;
                }
                if (r < r10)
                {
                    r = r10;
                }
                if (r < r11)
                {
                    r = r11;
                }
                if (r < r12)
                {
                    r = r12;
                }
                if (r < r13)
                {
                    r = r13;
                }
                if (r < r14)
                {
                    r = r14;
                }
                if (r < r15)
                {
                    r = r15;
                }
                if (r < r16)
                {
                    r = r16;
                }
                if (r < r17)
                {
                    r = r17;
                }
                if (r < r18)
                {
                    r = r18;
                }
                #endregion
                tjdao.updateTJbgdcXuechanggui(aichive_no, bar_code, r);
                tjdao.updatePEXcgInfo(aichive_no, bar_code, HGB, WBC, PLT);
                testFunDelegate(r, 8, rowIndex);
                MessageBox.Show("数据保存成功!");
            }
            else
            {
                MessageBox.Show("数据保存失败!");
            }
        }