예제 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            string WBC    = this.textBox5.Text;
            string LEU    = this.textBox6.Text;
            string NIT    = this.textBox8.Text;
            string URO    = this.textBox7.Text;
            string PRO    = this.textBox11.Text;
            string PH     = this.textBox10.Text;
            string BLD    = this.textBox13.Text;
            string SG     = this.textBox12.Text;
            string KET    = this.textBox15.Text;
            string BIL    = this.textBox14.Text;
            string GLU    = this.textBox17.Text;
            string Vc     = this.textBox16.Text;
            string MA     = this.textBox19.Text;
            string ACR    = this.textBox18.Text;
            string Ca     = this.textBox21.Text;
            string CR     = this.textBox20.Text;
            bool   istrue = false;

            if (_isHaveData)
            {
                istrue = tjdao.updateNiaochangguiInfo(aichive_no, bar_code, WBC, LEU, NIT, URO, PRO, PH, BLD, SG, KET, BIL, GLU, Vc, MA, ACR, Ca, CR);
            }
            else
            {
                istrue = tjdao.insertNiaojiInfo(aichive_no, id_number, bar_code, WBC, KET, NIT, URO, BIL, GLU, PRO, SG, PH, BLD, Vc, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "11G", basicInfoSettings.ncg);
            }
            if (istrue)
            {
                int r = 1;
                #region bgdc表中显示什么颜色
                int r0 = GetJudgeResultForWBC(WBC);
                int r1 = GetJudgeResultForNIT(NIT);
                int r2 = GetJudgeResultForURO(URO);
                int r3 = GetJudgeResultForPRO(PRO);
                int r4 = 1;
                if (PH != "")
                {
                    double b = 0;
                    bool   a = double.TryParse(PH, out b);
                    if (a == true)
                    {
                        r4 = GetJudgeResultForPH(b);
                    }
                }
                int r5 = GetJudgeResultForBLD(BLD);
                int r6 = 1;
                if (SG != "")
                {
                    double b = 0;
                    bool   a = double.TryParse(SG, out b);
                    if (a == true)
                    {
                        r6 = GetJudgeResultForSG(b);
                    }
                }
                int r7  = GetJudgeResultForKET(KET);
                int r8  = GetJudgeResultForBIL(BIL);
                int r9  = GetJudgeResultForGLU(GLU);
                int r10 = GetJudgeResultForVC(Vc);
                int r11 = 1;
                if (MA != "")
                {
                    double b = 0;
                    bool   a = double.TryParse(MA, out b);
                    if (a == true)
                    {
                        r11 = GetJudgeResultForMA(b);
                    }
                }

                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;
                }
                #endregion
                tjdao.updateTJbgdcNiaochanggui(aichive_no, bar_code, r);
                tjdao.updatePENcgInfo(aichive_no, bar_code, PRO, GLU, KET, BLD);
                testFunDelegate(r, 9, rowIndex);
                MessageBox.Show("数据保存成功!");
            }
            else
            {
                MessageBox.Show("数据保存失败!");
            }
        }