public AddReviewDetails(IDBOperation dbOperation, int id,SysReviewInfo sysreviewinfo)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;
            this.sysreviewinfo = sysreviewinfo;
            dbHelper = DbHelperMySQL.CreateDbHelper();

            orderid = id;

            string reviewflag = dbHelper.GetSingle(string.Format("select ReviewFlag from t_detect_report where ORDERID = '{0}'", id)).ToString();
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details('{0}')", id)).Tables[0];

            //给画面上的控件赋值
            _areaName.Text = table.Rows[0][10].ToString();
            _companyName.Text = table.Rows[0][11].ToString();
            _cardId.Text = table.Rows[0][12].ToString();
            _itemName.Text = table.Rows[0][3].ToString();
            _objectName.Text = table.Rows[0][4].ToString();
            _sampleName.Text = table.Rows[0][5].ToString();
            _reagentName.Text = table.Rows[0][7].ToString();
            _sensitivityName.Text = table.Rows[0][6].ToString();
            _resultName.Text = table.Rows[0][8].ToString();
            _deptName.Text = table.Rows[0][2].ToString();
            _detectDate.Text = table.Rows[0][1].ToString();
            _detectUserName.Text = table.Rows[0][9].ToString();
            _detectTypeName.Text = table.Rows[0][0].ToString();


            if (reviewflag == "1")
            {
                _reviewUserid.Text = table.Rows[0][14].ToString();
                _reviewReagent_text.Text = table.Rows[0][15].ToString();
                _reviewResult_text.Text = table.Rows[0][16].ToString();
                _reviewDate.Text = table.Rows[0][17].ToString();
                _reviewBz.Text = table.Rows[0][19].ToString();
                btnSave.Visibility = Visibility.Hidden;
                _reviewReagent.Visibility = Visibility.Hidden;
                _reviewResult.Visibility = Visibility.Hidden;
                _reviewReagent_text.Visibility = Visibility.Visible;
                _reviewResult_text.Visibility = Visibility.Visible;
                _reviewBz.IsEnabled = false;

            }
            else
            {
                _reviewUserid.Text = (Application.Current.Resources["User"] as UserInfo).ShowName;
                _reviewDate.Text = DateTime.Now.ToString();
                ComboboxTool.InitComboboxSource(_reviewResult, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr");
                ComboboxTool.InitComboboxSource(_reviewReagent, "select reagentId,reagentName from t_det_reagent where openFlag = '1' and reagentId <> '1'", "lr");

                btnSave.Visibility = Visibility.Visible;
                _reviewReagent.Visibility = Visibility.Visible;
                _reviewResult.Visibility = Visibility.Visible;
                _reviewReagent_text.Visibility = Visibility.Hidden;
                _reviewResult_text.Visibility = Visibility.Hidden;
                _reviewBz.IsEnabled = true;
            }

        }
        public AddReviewDetails(IDBOperation dbOperation, int id, SysReviewInfo sysreviewinfo)
        {
            InitializeComponent();

            this.dbOperation   = dbOperation;
            this.sysreviewinfo = sysreviewinfo;
            dbHelper           = DbHelperMySQL.CreateDbHelper();

            orderid = id;

            string    reviewflag = dbHelper.GetSingle(string.Format("select ReviewFlag from t_detect_report where ORDERID = '{0}'", id)).ToString();
            DataTable table      = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details('{0}')", id)).Tables[0];

            //给画面上的控件赋值
            _areaName.Text        = table.Rows[0][10].ToString();
            _companyName.Text     = table.Rows[0][11].ToString();
            _cardId.Text          = table.Rows[0][12].ToString();
            _itemName.Text        = table.Rows[0][3].ToString();
            _objectName.Text      = table.Rows[0][4].ToString();
            _sampleName.Text      = table.Rows[0][5].ToString();
            _reagentName.Text     = table.Rows[0][7].ToString();
            _sensitivityName.Text = table.Rows[0][6].ToString();
            _resultName.Text      = table.Rows[0][8].ToString();
            _deptName.Text        = table.Rows[0][2].ToString();
            _detectDate.Text      = table.Rows[0][1].ToString();
            _detectUserName.Text  = table.Rows[0][9].ToString();
            _detectTypeName.Text  = table.Rows[0][0].ToString();


            if (reviewflag == "1")
            {
                _reviewUserid.Text             = table.Rows[0][14].ToString();
                _reviewReagent_text.Text       = table.Rows[0][15].ToString();
                _reviewResult_text.Text        = table.Rows[0][16].ToString();
                _reviewDate.Text               = table.Rows[0][17].ToString();
                _reviewBz.Text                 = table.Rows[0][19].ToString();
                btnSave.Visibility             = Visibility.Hidden;
                _reviewReagent.Visibility      = Visibility.Hidden;
                _reviewResult.Visibility       = Visibility.Hidden;
                _reviewReagent_text.Visibility = Visibility.Visible;
                _reviewResult_text.Visibility  = Visibility.Visible;
                _reviewBz.IsEnabled            = false;
            }
            else
            {
                _reviewUserid.Text = (Application.Current.Resources["User"] as UserInfo).ShowName;
                _reviewDate.Text   = DateTime.Now.ToString();
                ComboboxTool.InitComboboxSource(_reviewResult, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr");
                ComboboxTool.InitComboboxSource(_reviewReagent, "select reagentId,reagentName from t_det_reagent where openFlag = '1' and reagentId <> '1'", "lr");

                btnSave.Visibility             = Visibility.Visible;
                _reviewReagent.Visibility      = Visibility.Visible;
                _reviewResult.Visibility       = Visibility.Visible;
                _reviewReagent_text.Visibility = Visibility.Hidden;
                _reviewResult_text.Visibility  = Visibility.Hidden;
                _reviewBz.IsEnabled            = true;
            }
        }
        public AddReviewDetails(IDBOperation dbOperation, int id,SysReviewInfo sysreviewinfo)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;
            this.sysreviewinfo = sysreviewinfo;
            dbHelper = DbHelperMySQL.CreateDbHelper();

            orderid = id;

            string reviewflag = dbHelper.GetSingle(string.Format("select ReviewFlag from t_detect_report where ORDERID = '{0}'", id)).ToString();
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details_new('{0}')", id)).Tables[0];

            //给画面上的控件赋值
            //图片地址改为从数据库中获取
            string picture_url = dbOperation.GetDbHelper().GetSingle("select pictureurl from t_url ").ToString();
            if (picture_url == "")
            {
                picture_url = "http://www.zrodo.com:8080/xmjc/";
            }
            _img.Source = new BitmapImage(new Uri(picture_url + table.Rows[0][20].ToString()));
            //_img.Source = new BitmapImage(new Uri("http://www.zrodo.com:8080/xmjc/" + table.Rows[0][20].ToString()));
            _orderid.Text = table.Rows[0][18].ToString();
            _areaName.Text = table.Rows[0][10].ToString();
            _companyName.Text = table.Rows[0][11].ToString();
            _cardId.Text = table.Rows[0][12].ToString();
            _objectLable.Text = table.Rows[0][21].ToString();
            _objectCount.Text = table.Rows[0][22].ToString();
            _itemName.Text = table.Rows[0][3].ToString();
            _objectName.Text = table.Rows[0][4].ToString();
            _sampleName.Text = table.Rows[0][5].ToString();
            _reangetName.Text = table.Rows[0][7].ToString();
            _sensitivityName.Text = table.Rows[0][6].ToString();
            _resultName.Text = table.Rows[0][8].ToString();
            _deptName.Text = table.Rows[0][2].ToString();
            _detectDate.Text = table.Rows[0][1].ToString();
            _detectUserName.Text = table.Rows[0][9].ToString();
            _detectTypeName.Text = table.Rows[0][0].ToString();
            _cardbrand.Text = table.Rows[0][23].ToString();
            _cardno.Text = table.Rows[0][24].ToString();

            //检测结果为疑似阳性变红
            if (_resultName.Text == "疑似阳性" || _resultName.Text == "确证阳性")
            {
                _resultName.Foreground = Brushes.Red;
            }
            else
            {
                _resultName.Foreground = Brushes.Black;
            }


            if (reviewflag == "1")
            {
                _reviewUserid.Text = table.Rows[0][14].ToString();
                _reviewReagent_text.Text = table.Rows[0][15].ToString();
                _reviewResult_text.Text = table.Rows[0][16].ToString();
                _reviewDate.Text = table.Rows[0][17].ToString();
                _reviewBz.Text = table.Rows[0][19].ToString();
                btnSave.Visibility = Visibility.Hidden;
                _reviewReagent.Visibility = Visibility.Hidden;
                _reviewResult.Visibility = Visibility.Hidden;
                _reviewReagent_text.Visibility = Visibility.Visible;
                _reviewResult_text.Visibility = Visibility.Visible;
                _reviewBz.IsEnabled = false;

            }
            else
            {
                _reviewUserid.Text = (Application.Current.Resources["User"] as UserInfo).ShowName;
                _reviewDate.Text = DateTime.Now.ToString();
                ComboboxTool.InitComboboxSource(_reviewResult, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr");
                ComboboxTool.InitComboboxSource(_reviewReagent, "select reagentId,reagentName from t_det_reagent where openFlag = '1' and reagentId <> '1'", "lr");

                btnSave.Visibility = Visibility.Visible;
                _reviewReagent.Visibility = Visibility.Visible;
                _reviewResult.Visibility = Visibility.Visible;
                _reviewReagent_text.Visibility = Visibility.Hidden;
                _reviewResult_text.Visibility = Visibility.Hidden;
                _reviewBz.IsEnabled = true;
            }

        }
        public AddReviewDetails(IDBOperation dbOperation, int id, SysReviewInfo sysreviewinfo)
        {
            InitializeComponent();

            this.dbOperation   = dbOperation;
            this.sysreviewinfo = sysreviewinfo;
            dbHelper           = DbHelperMySQL.CreateDbHelper();

            orderid = id;

            string    reviewflag = dbHelper.GetSingle(string.Format("select ReviewFlag from t_detect_report where ORDERID = '{0}'", id)).ToString();
            DataTable table      = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details_new('{0}')", id)).Tables[0];

            //给画面上的控件赋值
            //图片地址改为从数据库中获取
            string picture_url = dbOperation.GetDbHelper().GetSingle("select pictureurl from t_url ").ToString();

            if (picture_url == "")
            {
                picture_url = "http://www.zrodo.com:8080/xmjc/";
            }
            _img.Source = new BitmapImage(new Uri(picture_url + table.Rows[0][20].ToString()));
            //_img.Source = new BitmapImage(new Uri("http://www.zrodo.com:8080/xmjc/" + table.Rows[0][20].ToString()));
            _orderid.Text         = table.Rows[0][18].ToString();
            _areaName.Text        = table.Rows[0][10].ToString();
            _companyName.Text     = table.Rows[0][11].ToString();
            _cardId.Text          = table.Rows[0][12].ToString();
            _objectLable.Text     = table.Rows[0][21].ToString();
            _objectCount.Text     = table.Rows[0][22].ToString();
            _itemName.Text        = table.Rows[0][3].ToString();
            _objectName.Text      = table.Rows[0][4].ToString();
            _sampleName.Text      = table.Rows[0][5].ToString();
            _reangetName.Text     = table.Rows[0][7].ToString();
            _sensitivityName.Text = table.Rows[0][6].ToString();
            _resultName.Text      = table.Rows[0][8].ToString();
            _deptName.Text        = table.Rows[0][2].ToString();
            _detectDate.Text      = table.Rows[0][1].ToString();
            _detectUserName.Text  = table.Rows[0][9].ToString();
            _detectTypeName.Text  = table.Rows[0][0].ToString();
            _cardbrand.Text       = table.Rows[0][23].ToString();
            _cardno.Text          = table.Rows[0][24].ToString();

            //检测结果为疑似阳性变红
            if (_resultName.Text == "疑似阳性" || _resultName.Text == "确证阳性")
            {
                _resultName.Foreground = Brushes.Red;
            }
            else
            {
                _resultName.Foreground = Brushes.Black;
            }


            if (reviewflag == "1")
            {
                _reviewUserid.Text             = table.Rows[0][14].ToString();
                _reviewReagent_text.Text       = table.Rows[0][15].ToString();
                _reviewResult_text.Text        = table.Rows[0][16].ToString();
                _reviewDate.Text               = table.Rows[0][17].ToString();
                _reviewBz.Text                 = table.Rows[0][19].ToString();
                btnSave.Visibility             = Visibility.Hidden;
                _reviewReagent.Visibility      = Visibility.Hidden;
                _reviewResult.Visibility       = Visibility.Hidden;
                _reviewReagent_text.Visibility = Visibility.Visible;
                _reviewResult_text.Visibility  = Visibility.Visible;
                _reviewBz.IsEnabled            = false;
            }
            else
            {
                _reviewUserid.Text = (Application.Current.Resources["User"] as UserInfo).ShowName;
                _reviewDate.Text   = DateTime.Now.ToString();
                ComboboxTool.InitComboboxSource(_reviewResult, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr");
                ComboboxTool.InitComboboxSource(_reviewReagent, "select reagentId,reagentName from t_det_reagent where openFlag = '1' and reagentId <> '1'", "lr");

                btnSave.Visibility             = Visibility.Visible;
                _reviewReagent.Visibility      = Visibility.Visible;
                _reviewResult.Visibility       = Visibility.Visible;
                _reviewReagent_text.Visibility = Visibility.Hidden;
                _reviewResult_text.Visibility  = Visibility.Hidden;
                _reviewBz.IsEnabled            = true;
            }
        }