private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_query_detect_new({0},'{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}',{16},{17})",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID,
                                                                                 //dtpStartDate.Value.ToString() == dtpEndDate.Value.ToString() ? "" : dtpStartDate.Value.ToString(),
                                                                                 //dtpStartDate.Value.ToString() == dtpEndDate.Value.ToString() ? "" : dtpEndDate.Value.ToString(),
                                                                                 ((DateTime)dtpStartDate.SelectedDate).ToShortDateString(),
                                                                                 ((DateTime)dtpEndDate.SelectedDate).ToShortDateString(),
                                                                                 _province1.SelectedIndex < 1 ? "" : (_province1.SelectedItem as Label).Tag,
                                                                                 _city1.SelectedIndex < 1 ? "" : (_city1.SelectedItem as Label).Tag,
                                                                                 _region1.SelectedIndex < 1 ? "" : (_region1.SelectedItem as Label).Tag,
                                                                                 _source_company1.SelectedIndex < 1 ? "" : (_source_company1.SelectedItem as Label).Tag,
                                                                                 _detect_station.SelectedIndex < 1 ? "" : (_detect_station.SelectedItem as Label).Tag,
                                                                                 _detect_item1.SelectedIndex < 1 ? "" : (_detect_item1.SelectedItem as Label).Tag,
                                                                                 _detect_object1.SelectedIndex < 1 ? "" : (_detect_object1.SelectedItem as Label).Tag,
                                                                                 _detect_result1.SelectedIndex < 1 ? "" : (_detect_result1.SelectedItem as Label).Tag,
                                                                                 _detect_method.SelectedIndex < 1 ? "" : (_detect_method.SelectedItem as Label).Tag,
                                                                                 _detect_person1.SelectedIndex < 1 ? "" : (_detect_person1.SelectedItem as Label).Tag,
                                                                                 _detect_type.SelectedIndex < 1 ? "" : (_detect_type.SelectedItem as Label).Tag,
                                                                                 _card_brand.SelectedIndex < 1 ? "" : (_card_brand.SelectedItem as Label).Tag,
                                                                                 _detect_huanjie.SelectedIndex < 1 ? "" : (_detect_huanjie.SelectedItem as Label).Tag,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
        }
Exemple #2
0
        //上传图片至数据库
        private void UploadIMG()
        {
            //将所选文件的读入字节数组img
            byte[] img = File.ReadAllBytes(FileNameTextBox.Text);
            //FileInfo fi = new FileInfo( FileNameTextBox.Text);
            if (img.Length > 65 * 1024)
            {
                Toolkit.MessageBox.Show("上传图片大小不能大于65KB!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            //string fileName = System.IO.Path.GetFileNameWithoutExtension(FileNameTextBox.Text);

            //string sql = String.Format("update sys_client_sysdept set image = '{0}'  where INFO_CODE = '{1}'", img, (Application.Current.Resources["User"] as UserInfo).DepartmentID);
            //int count = dbOperation.GetDbHelper().ExecuteSql(sql);
            int count = dbOperation.GetDbHelper().Load_Picture((Application.Current.Resources["User"] as UserInfo).DepartmentID, img);

            if (count == 1)
            {
                Toolkit.MessageBox.Show("图片上传成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                Toolkit.MessageBox.Show("图片上传失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
        }
 private DataTable GetTrendAnalysisData(string theme, string year)
 {
     try
     {
         if (_analysis_theme.SelectedIndex > 0 && _analysis_theme.Text == "年度各项目检测执行趋势分析")
         {
             return(dbOperation.GetDbHelper().GetDataSet(string.Format("call sp_ndxmqs('{0}','{1}')", (Application.Current.Resources["User"] as UserInfo).ID, year)).Tables[0]);
         }
         else if (_analysis_theme.SelectedIndex > 0 && _analysis_theme.Text == "年度各检测项目阳性样本检出趋势分析")
         {
             return(dbOperation.GetDbHelper().GetDataSet(string.Format("call sp_ndyxqs('{0}','{1}')", (Application.Current.Resources["User"] as UserInfo).ID, year)).Tables[0]);
         }
         else if (_analysis_theme.SelectedIndex > 0 && _analysis_theme.Text == "年度各检测项目疑似阳性样本检出趋势分析")
         {
             return(dbOperation.GetDbHelper().GetDataSet(string.Format("call sp_ndyxqs_like('{0}','{1}')", (Application.Current.Resources["User"] as UserInfo).ID, year)).Tables[0]);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(".SysTrendAnalysis.GetTrendAnalysisData异常");
         throw new Exception(e.Message);
     }
 }
Exemple #4
0
        //private void _query_Click(object sender, RoutedEventArgs e)
        //{
        //    if (reportDate_kssj.SelectedDate.Value.Date > reportDate_jssj.SelectedDate.Value.Date)
        //    {
        //        Toolkit.MessageBox.Show("开始时间大于结束时间,请重新选择!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
        //        return;
        //    }

        //    _tableview.GetDataByPageNumberEvent += new UcTableOperableView_NoTitle.GetDataByPageNumberEventHandler(_tableview_GetDataByPageNumberEvent);
        //    GetData();
        //    //_tableview.Title = string.Format("数据统计时间:{0}年{1}月{2}日到{3}年{4}月{5}日", reportDate_kssj.SelectedDate.Value.Year, reportDate_kssj.SelectedDate.Value.Month, reportDate_kssj.SelectedDate.Value.Day,
        //    //              reportDate_jssj.SelectedDate.Value.Year, reportDate_jssj.SelectedDate.Value.Month, reportDate_jssj.SelectedDate.Value.Day);
        //    //_title.Text = string.Format("▪ 数据统计时间:{0}年{1}月{2}日到{3}年{4}月{5}日  合计{6}条数据", reportDate_kssj.SelectedDate.Value.Year, reportDate_kssj.SelectedDate.Value.Month, reportDate_kssj.SelectedDate.Value.Day,
        //    //              reportDate_jssj.SelectedDate.Value.Year, reportDate_jssj.SelectedDate.Value.Month, reportDate_jssj.SelectedDate.Value.Day, _tableview.RowTotal);

        //    _sj.Visibility = Visibility.Visible;
        //    _hj.Visibility = Visibility.Visible;
        //    _title.Text = _tableview.RowTotal.ToString();
        //    _tableview.PageIndex = 1;

        //    if (_tableview.RowTotal == 0)
        //    {
        //        Toolkit.MessageBox.Show("没有查询到数据!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
        //        return;
        //    }

        //}

        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_warning_info_new({0},{1},{2})",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
            current_table    = table;

            string sum = "";

            if (table.Rows.Count != 0)
            {
                sum            = table.Rows[0][10].ToString();
                _sj.Visibility = Visibility.Visible;
                _hj.Visibility = Visibility.Visible;
                _title.Text    = sum;
            }

            _tableview.PageIndex = 1;

            //if (_tableview.RowTotal == 0)
            //{
            //    Toolkit.MessageBox.Show("没有查询到数据!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
            //    return;
            //}
        }
Exemple #5
0
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_query_detect({0},'{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}',{15},{16})",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID,
                                                                                 //dtpStartDate.Value.ToString() == dtpEndDate.Value.ToString() ? "" : dtpStartDate.Value.ToString(),
                                                                                 //dtpStartDate.Value.ToString() == dtpEndDate.Value.ToString() ? "" : dtpEndDate.Value.ToString(),
                                                                                 ((DateTime)dtpStartDate.Value).ToShortDateString(),
                                                                                 ((DateTime)dtpEndDate.Value).ToShortDateString(),
                                                                                 _province1.SelectedIndex < 1 ? "" : (_province1.SelectedItem as Label).Tag,
                                                                                 _city1.SelectedIndex < 1 ? "" : (_city1.SelectedItem as Label).Tag,
                                                                                 _region1.SelectedIndex < 1 ? "" : (_region1.SelectedItem as Label).Tag,
                                                                                 _source_company1.SelectedIndex < 1 ? "" : (_source_company1.SelectedItem as Label).Tag,
                                                                                 _detect_station.SelectedIndex < 1 ? "" : (_detect_station.SelectedItem as Label).Tag,
                                                                                 _detect_item1.SelectedIndex < 1 ? "" : (_detect_item1.SelectedItem as Label).Tag,
                                                                                 _detect_object1.SelectedIndex < 1 ? "" : (_detect_object1.SelectedItem as Label).Tag,
                                                                                 _detect_result1.SelectedIndex < 1 ? "" : (_detect_result1.SelectedItem as Label).Tag,
                                                                                 _detect_method.SelectedIndex < 1 ? "" : (_detect_method.SelectedItem as Label).Tag,
                                                                                 _detect_person1.SelectedIndex < 1 ? "" : (_detect_person1.SelectedItem as Label).Tag,
                                                                                 _detect_type.SelectedIndex < 1 ? "" : (_detect_type.SelectedItem as Label).Tag,
                                                                                 _dept_type.SelectedIndex < 1 ? "" : (_dept_type.SelectedItem as Label).Tag,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
            //for (int i = 0; i < table.Rows.Count; i++)
            //{
            //    if(table.Rows[i][8].ToString() == "疑似阳性")
            //    {
            //        _tableview._gridview.Columns[]
            //    }
            //}
        }
Exemple #6
0
        private void _query_Click(object sender, RoutedEventArgs e)
        {
            string shipper_name;

            if (_shipper_name.SelectedIndex == 0)
            {
                shipper_name = "";
            }
            else
            {
                shipper_name = _shipper_name.Text;
            }

            System.Data.DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_innocent_query('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
                                                                                             deptId,
                                                                                             ((DateTime)dtpStartDate.SelectedDate).ToShortDateString(),
                                                                                             ((DateTime)dtpEndDate.SelectedDate).ToShortDateString(),
                                                                                             _detect_station.SelectedIndex < 1 ? "" : (_detect_station.SelectedItem as System.Windows.Controls.Label).Tag,
                                                                                             _detect_person1.SelectedIndex < 1 ? "" : (_detect_person1.SelectedItem as System.Windows.Controls.Label).Tag,
                                                                                             shipper_name, _qua_cardid.Text)).Tables[0];

            _sj.Visibility = Visibility.Visible;
            _hj.Visibility = Visibility.Visible;
            _title.Text    = (table.Rows.Count - 1).ToString();

            livst.DataContext = table;
            if ((table.Rows.Count - 1) == 0)
            {
                Toolkit.MessageBox.Show("没有查询到数据!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
        }
        void timer_Tick(object sender, EventArgs e)
        {
            if (flag == 0)
            {
                LoadWindow load = new LoadWindow();
                load.Show();

                Application.Current.Resources.Add("省市表", dbOperation.GetProvinceCity());
                UserInfo userInfo = Application.Current.Resources["User"] as UserInfo;
                this.userName = userInfo.ShowName;

                //加载标题
                this._user.Text = this.userName;
                //this._date.Text = DateTime.Now.ToLongDateString().ToString() +  DateTime.Now.ToString("dddd");
                this._date.Text = DateTime.Now.ToLongDateString().ToString();

                DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("select companyName,phone from t_supplier where supplierId ='{0}'", (Application.Current.Resources["User"] as UserInfo).SupplierId == "" ? "zrd" : (Application.Current.Resources["User"] as UserInfo).SupplierId)).Tables[0];
                this._bottom.Text = "版权所有:" + table.Rows[0][0].ToString() + "  软著登字第0814101号    版本号:" + ConfigurationManager.AppSettings["version"] + "    技术服务热线:" + table.Rows[0][1].ToString();

                //DataTable dt = dbOperation.GetDbHelper().GetDataSet(string.Format("SELECT title,image from sys_client_sysdept where INFO_CODE ='{0}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID)).Tables[0];
                string dept_str = "";
                if (deptId.Length >= 3)
                {
                    dept_str = deptId.Substring(0, 3).ToString();
                }
                else
                {
                    dept_str = deptId;
                }

                DataTable dt = dbOperation.GetDbHelper().GetDataSet(string.Format("SELECT title,image,INFO_NAME from sys_client_sysdept where INFO_CODE ='{0}'", dept_str)).Tables[0];
                if (dt.Rows[0][0].ToString() != "")
                {
                    this._title_dept.Text = dt.Rows[0][0].ToString();
                }
                else if (dt.Rows[0][2].ToString() != "")
                {
                    this._title_dept.Text = dt.Rows[0][2].ToString();
                }

                if (dt.Rows[0][1].ToString() != null && dt.Rows[0][1].ToString() != "")
                {
                    byte[] img = (byte[])dt.Rows[0][1];
                    ShowSelectedIMG(img);                //以流的方式显示图片的方法
                }

                this._logo.Visibility    = Visibility.Visible;
                this._title_1.Visibility = Visibility.Visible;
                //this._title_2.Visibility = Visibility.Visible;

                //加载父菜单和子菜单和首页
                MainMenu_Load();
                this.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged);

                flag           = 1;
                timer.Interval = new TimeSpan(1000);
                load.Close();
            }
            //header.UpdateTime();
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (_grade_down.Text == "" || _grade_up.Text == "")
            {
                _txtmsg.Text = "*请输入参数!*";
                return;
            }

            if (int.Parse(_grade_up.Text) <= int.Parse(_grade_down.Text))
            {
                _txtmsg.Text = "*参数下限值必须小于上限值!";
                return;
            }

            if (int.Parse(_grade_up.Text) > 100 || int.Parse(_grade_down.Text) > 100)
            {
                _txtmsg.Text = "*参数值必须小于100!";
                return;
            }

            bool exit_flag = dbOperation.GetDbHelper().Exists(string.Format("select count(gradeId) from t_city_grade where cityId = '{0}' and gradeId = '{1}'", deptId, gradeId));

            if (exit_flag)
            {
                int n = dbOperation.GetDbHelper().ExecuteSql(string.Format("update t_city_grade set parameterDown='{0}',parameterUp = '{1}',createUserid='{2}',createDate='{3}' where cityId = '{4}' and gradeId = '{5}' ",
                                                                           _grade_down.Text, _grade_up.Text,
                                                                           (Application.Current.Resources["User"] as UserInfo).ID,
                                                                           DateTime.Now, deptId, gradeId));
                if (n == 1)
                {
                    Toolkit.MessageBox.Show("检测任务指标更新成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    systaskcheck.loadTaskGrade();
                    this.Close();
                }
                else
                {
                    Toolkit.MessageBox.Show("检测任务指标更新失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
            }
            else
            {
                int n = dbOperation.GetDbHelper().ExecuteSql(string.Format("insert into t_city_grade(cityId,gradeId,parameterDown,parameterUp,createUserid,createDate) values('{0}','{1}','{2}','{3}','{4}', '{5}')",
                                                                           deptId, gradeId, _grade_down.Text, _grade_up.Text,
                                                                           (Application.Current.Resources["User"] as UserInfo).ID,
                                                                           DateTime.Now));
                if (n == 1)
                {
                    Toolkit.MessageBox.Show("检测任务指标插入成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    systaskcheck.loadTaskGrade();
                    this.Close();
                }
                else
                {
                    Toolkit.MessageBox.Show("检测任务指标插入失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    return;
                }
            }
        }
 void _object_id_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (_object_id.SelectedIndex > 0)
     {
         string object_type = dbOperation.GetDbHelper().GetSingle("select unit from t_animal_new where animalid =" + (_object_id.SelectedItem as Label).Tag.ToString()).ToString();
         _object_type.Text = object_type;
     }
 }
Exemple #10
0
 void _product_name_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (_product_name.SelectedIndex > 0)
     {
         string object_type = dbOperation.GetDbHelper().GetSingle("select unit from t_product where productid =" + (_product_name.SelectedItem as Label).Tag.ToString()).ToString();
         _object_type.Text = object_type;
     }
 }
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_warning_report_details('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
                                                                                 Kssj, Jssj, DeptId, ItemId, ReviewFlag,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
        }
Exemple #12
0
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_task_check('{0}','{1}','{2}',{3},{4})",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID, _year.Text, _month.Text,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
            currenttable     = table;
        }
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_review_log_new('{0}','{1}','{2}','{3}','{4}',{5},{6})",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID, reportDate_kssj.SelectedDate, reportDate_jssj.SelectedDate,
                                                                                 _detect_dept.SelectedIndex < 1 ? "" : (_detect_dept.SelectedItem as Label).Tag,
                                                                                 _detect_item.SelectedIndex < 1 ? "" : (_detect_item.SelectedItem as Label).Tag,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
        }
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_warning_report_new('{0}','{1}','{2}','{3}','{4}','{5}')",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID, reportDate_kssj.SelectedDate, reportDate_jssj.SelectedDate,
                                                                                 _detect_dept.SelectedIndex < 1 ? "" : (_detect_dept.SelectedItem as Label).Tag,
                                                                                 item_id,
                                                                                 review_id)).Tables[0];

            _tableview.Table = table;
            current_table    = table;
        }
        private Rect rcnormal;//定义一个全局rect记录还原状态下窗口的位置和大小。


        public MainWindow(IDBOperation dbOperation)
        {
            //Rect rc = SystemParameters.WorkArea;//获取工作区大小
            this.Width  = 1366;
            this.Height = 766;
            InitializeComponent();
            this.dbOperation = dbOperation;
            UserInfo userInfo = Application.Current.Resources["User"] as UserInfo;

            this.userName = userInfo.ShowName;
            Application.Current.Resources.Add("省市表", dbOperation.GetProvinceCity());

            //加载标题
            this._user.Text = this.userName;
            //this._date.Text = DateTime.Now.ToLongDateString().ToString() +  DateTime.Now.ToString("dddd");
            this._date.Text = DateTime.Now.ToLongDateString().ToString();

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("select companyName,phone from t_supplier where supplierId ='{0}'", (Application.Current.Resources["User"] as UserInfo).SupplierId == "" ? "zrd" : (Application.Current.Resources["User"] as UserInfo).SupplierId)).Tables[0];

            this._bottom.Text = table.Rows[0][0].ToString() + "版权所有    版本号:" + ConfigurationManager.AppSettings["version"] + "    技术服务热线:" + table.Rows[0][1].ToString();

            DataTable dt = dbOperation.GetDbHelper().GetDataSet(string.Format("SELECT INFO_NAME,image from sys_client_sysdept where INFO_CODE ='{0}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID)).Tables[0];

            this._title_dept.Text = dt.Rows[0][0].ToString();
            if (dt.Rows[0][1].ToString() != null && dt.Rows[0][1].ToString() != "")
            {
                byte[] img = (byte[])dt.Rows[0][1];
                ShowSelectedIMG(img);                //以流的方式显示图片的方法
            }

            MainMenu_Load();
            this.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged);

            //加载主画面
            if (mainMenus[0].Flag_Exits == 1)
            {
                TabItem temptb = new TabItem();
                temptb.Header  = "首页";
                temptb.Content = new UcMainPage();

                _tab.Items.Add(temptb);
                _tab.SelectedIndex = _tab.Items.Count - 1;
            }

            //if (!FullScreenHelper.IsFullscreen(this))
            //{
            //    FullScreenHelper.GoFullscreen(this);
            //}
            //this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            //this.KeyDown += new KeyEventHandler(MainWindow_KeyDown);
            //this.StateChanged += new EventHandler(MainWindow_StateChanged);
        }
Exemple #16
0
        //判断登录用户的部门级别
        private bool isDept()
        {
            string flag = dbOperation.GetDbHelper().GetSingle("select FLAG_TIER from sys_client_sysdept where INFO_CODE =" + (Application.Current.Resources["User"] as UserInfo).DepartmentID).ToString();

            if (flag == "4")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public detectdetails(IDBOperation dbOperation, int id)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details('{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();
            _detecthuanjie.Text   = table.Rows[0][26].ToString();
            _detectnumber.Text    = table.Rows[0][27].ToString();

            //检测结果为疑似阳性变红
            if (_resultName.Text == "疑似阳性" || _resultName.Text == "确证阳性")
            {
                _resultName.Foreground = Brushes.Red;
            }
            else
            {
                _resultName.Foreground = Brushes.Black;
            }
        }
        private Rect rcnormal;//定义一个全局rect记录还原状态下窗口的位置和大小。


        public MainWindow(IDBOperation dbOperation)
        {
            //Rect rc = SystemParameters.WorkArea;//获取工作区大小
            this.Width = 1366;
            this.Height = 766;
            InitializeComponent();
            this.dbOperation = dbOperation;
            UserInfo userInfo = Application.Current.Resources["User"] as UserInfo;
            this.userName = userInfo.ShowName;
            Application.Current.Resources.Add("省市表", dbOperation.GetProvinceCity());

            //加载标题
            this._user.Text = this.userName;
            //this._date.Text = DateTime.Now.ToLongDateString().ToString() +  DateTime.Now.ToString("dddd");
            this._date.Text = DateTime.Now.ToLongDateString().ToString();

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("select companyName,phone from t_supplier where supplierId ='{0}'", (Application.Current.Resources["User"] as UserInfo).SupplierId == "" ? "zrd" : (Application.Current.Resources["User"] as UserInfo).SupplierId)).Tables[0];
            this._bottom.Text = table.Rows[0][0].ToString() + "版权所有    版本号:" + ConfigurationManager.AppSettings["version"] + "    技术服务热线:" + table.Rows[0][1].ToString();

            DataTable dt= dbOperation.GetDbHelper().GetDataSet(string.Format("SELECT INFO_NAME,image from sys_client_sysdept where INFO_CODE ='{0}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID)).Tables[0];
            this._title_dept.Text = dt.Rows[0][0].ToString();
            if (dt.Rows[0][1].ToString() != null && dt.Rows[0][1].ToString() != "")
            {
                byte[] img = (byte[])dt.Rows[0][1];
                ShowSelectedIMG(img);                //以流的方式显示图片的方法
            }

            MainMenu_Load();
            this.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged);

            //加载主画面
            if (mainMenus[0].Flag_Exits == 1)
            {
                TabItem temptb = new TabItem();
                temptb.Header = "首页";
                temptb.Content = new UcMainPage();

                _tab.Items.Add(temptb);
                _tab.SelectedIndex = _tab.Items.Count - 1;
            }

            //if (!FullScreenHelper.IsFullscreen(this))
            //{
            //    FullScreenHelper.GoFullscreen(this);
            //}
            //this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
            //this.KeyDown += new KeyEventHandler(MainWindow_KeyDown);
            //this.StateChanged += new EventHandler(MainWindow_StateChanged);
        }
        public detectdetails(IDBOperation dbOperation,int id)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details('{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();
            _detecthuanjie.Text = table.Rows[0][26].ToString();
            _detectnumber.Text = table.Rows[0][27].ToString();

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

            //检疫员所属部门货主信息flag,屠宰场名称,检疫分站名称
            DataTable table = dbOperation.GetDbHelper().GetDataSet("select ifnull(a.shipperflag,'') as shipperflag, " +
                                    " tzcname,INFO_NAME" +
                                    " from sys_client_sysdept a " +
                                    " where INFO_CODE = " + deptId).Tables[0];

            if (table.Rows.Count != 0)
            {
                shipperflag = table.Rows[0][0].ToString();
                _detect_site.Text = table.Rows[0][2].ToString();
                _slaughter_site.Text = table.Rows[0][1].ToString();
            }
            //申报人姓名
            ComboboxTool.InitComboboxSource(_shipper_name, string.Format("SELECT sbrid,sbrname FROM t_record_sbr WHERE openflag = '1' and createdeptid = '{0}'", deptId), "lr");
            //产地
            ComboboxTool.InitComboboxSource(_address, string.Format("SELECT areaid,areaname FROM t_record_area WHERE openflag = '1' and createdeptid = '{0}'", deptId), "lr");
            //协检员
            ComboboxTool.InitComboboxSource(_help_user, string.Format("call p_user_helpuser({0})", userId), "lr");
            //官方兽医姓名
            _user_name.Text = username;
            //录入时间
            _entering_datetime.Text = string.Format("{0:g}", System.DateTime.Now);
            //屠宰动物种类
            ComboboxTool.InitComboboxSource(_animal, "SELECT animalid,animalname FROM t_animal_new WHERE openflag = '1' and deptflag = '" + shipperflag + "'", "lr");
            _animal.SelectionChanged += new SelectionChangedEventHandler(_animal_SelectionChanged);
            _animal.SelectedIndex = 1;
            //临床情况
            DataTable dt_quater = new DataTable();
            dt_quater.Columns.Add(new DataColumn("quaterid"));
            dt_quater.Columns.Add(new DataColumn("quatername"));
            var row = dt_quater.NewRow();
            row["quaterid"] = "0";
            row["quatername"] = "良好";
            dt_quater.Rows.Add(row);
            var row2 = dt_quater.NewRow();
            row2["quaterid"] = "1";
            row2["quatername"] = "异常";
            dt_quater.Rows.Add(row2);
            ComboboxTool.InitComboboxSource(_quater, dt_quater, "lr");

            //是否佩戴规定的畜禽标识
            DataTable dt_object_flag = new DataTable();
            dt_object_flag.Columns.Add(new DataColumn("flagid"));
            dt_object_flag.Columns.Add(new DataColumn("flagname"));
            var row3 = dt_object_flag.NewRow();
            row3["flagid"] = "1";
            row3["flagname"] = "是";
            dt_object_flag.Rows.Add(row3);
            var row4 = dt_object_flag.NewRow();
            row4["flagid"] = "0";
            row4["flagname"] = "否";
            dt_object_flag.Rows.Add(row4);
            ComboboxTool.InitComboboxSource(_object_flag, dt_object_flag, "lr");

        }
Exemple #21
0
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_warning_report_country('{0}','{1}','{2}','{3}','{4}')",
                                                                                 Kssj, Jssj, DeptId, ItemId, ReviewFlag)).Tables[0];

            _tableview.Table = table;
        }
        public detectdetails(IDBOperation dbOperation,int id)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;

            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();
            _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();

            
        }
        public detectDetailsReview(IDBOperation dbOperation, int id)
        {
            InitializeComponent();

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

            orderid = id;

            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();
            _reviewBz.Text           = table.Rows[0][19].ToString();
            _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();
        }
        public CertificatePreview(IDBOperation dbOperation, string card_id)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            this.cardId      = card_id;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_certificate_main('{0}')", cardId)).Tables[0];

            if (table.Rows.Count > 0)
            {
                _card_id.Text       = table.Rows[0][0].ToString();
                _company.Text       = table.Rows[0][2].ToString();
                _phone.Text         = table.Rows[0][6].ToString();
                _detect_object.Text = table.Rows[0][4].ToString();
                _object_count.Text  = table.Rows[0][5].ToString();
                _for_use.Text       = table.Rows[0][7].ToString();
                _city_ks.Text       = table.Rows[0][8].ToString();
                _region_ks.Text     = table.Rows[0][9].ToString();
                _town_ks.Text       = table.Rows[0][10].ToString();
                _village_ks.Text    = table.Rows[0][11].ToString();
                _city_js.Text       = table.Rows[0][12].ToString();
                _region_js.Text     = table.Rows[0][13].ToString();
                _town_js.Text       = table.Rows[0][14].ToString();
                _village_js.Text    = table.Rows[0][15].ToString();
                _object_lable.Text  = table.Rows[0][16].ToString();
                _user_name.Text     = table.Rows[0][17].ToString();
                _user_id.Text       = table.Rows[0][21].ToString();
                _nian.Text          = ConvertStr.convert_nian(table.Rows[0][18].ToString());
                _yue.Text           = ConvertStr.convert_yue(table.Rows[0][19].ToString());
                _day.Text           = ConvertStr.convert_day(table.Rows[0][20].ToString());
            }
        }
        public detectDetailsReview(IDBOperation dbOperation, int id)
        {
            InitializeComponent();

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

            orderid = id;

            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();
            _reviewBz.Text = table.Rows[0][19].ToString();
            _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();
        }
        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 SysTrendAnalysis(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_year_count({0})", (Application.Current.Resources["User"] as UserInfo).ID)).Tables[0];
            List<string> years = new List<string>();
            years.Add("-请选择-");
            for (int i = 0; i < table.Rows.Count; i++)
            {
                years.Add(table.Rows[i][0].ToString());
            }

            _year.ItemsSource = years;
            _year.SelectedIndex = 0;

            List<string> analysisThemes = new List<string>();
            analysisThemes.Add("-请选择-");
            analysisThemes.Add("年度各项目检测执行趋势分析");
            analysisThemes.Add("年度各检测项目阳性样本检出趋势分析");
            analysisThemes.Add("年度各检测项目疑似阳性样本检出趋势分析");
            _analysis_theme.ItemsSource = analysisThemes;
            _analysis_theme.SelectedIndex = 0;

            this.SizeChanged += new SizeChangedEventHandler(SysTrendAnalysis_SizeChanged);
            _chart.SizeChanged += new SizeChangedEventHandler(_chart_SizeChanged);
        }
Exemple #28
0
        public CertificateProductPreview(IDBOperation dbOperation, string card_id)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            this.cardId      = card_id;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_certificate_product_main('{0}')", cardId)).Tables[0];

            if (table.Rows.Count > 0)
            {
                _card_id.Text      = table.Rows[0][0].ToString();
                _company.Text      = table.Rows[0][2].ToString();
                _product_name.Text = table.Rows[0][4].ToString();
                _object_count.Text = table.Rows[0][5].ToString();
                _cz_cardid.Text    = table.Rows[0][3].ToString();
                _product_area.Text = table.Rows[0][6].ToString();
                _dept_name.Text    = table.Rows[0][7].ToString() + "              " + table.Rows[0][8].ToString();
                _mdd.Text          = table.Rows[0][9].ToString();
                _bz.Text           = table.Rows[0][10].ToString();
                _user_name.Text    = table.Rows[0][11].ToString();
                _user_id.Text      = table.Rows[0][15].ToString();
                _nian.Text         = ConvertStr.convert_nian(table.Rows[0][12].ToString());
                _yue.Text          = ConvertStr.convert_yue(table.Rows[0][13].ToString());
                _day.Text          = ConvertStr.convert_day(table.Rows[0][14].ToString());
            }
        }
        private void _query_Click(object sender, RoutedEventArgs e)
        {
            //清空列表
            lvlist.DataContext = null;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_query_certificate_new_new({0},'{1}','{2}','{3}','{4}','{5}')",
                                                                                 (Application.Current.Resources["User"] as UserInfo).ID,
                                                                                 ((DateTime)dtpStartDate.SelectedDate).ToShortDateString(),
                                                                                 ((DateTime)dtpEndDate.SelectedDate).ToShortDateString(),
                                                                                 _card_no.Text,
                                                                                 _source_company.Text,
                                                                                 _source_name.Text)).Tables[0];

            current_table      = table;
            lvlist.DataContext = table;

            _sj.Visibility = Visibility.Visible;
            _hj.Visibility = Visibility.Visible;
            _title.Text    = table.Rows.Count.ToString();

            if (table.Rows.Count == 0)
            {
                Toolkit.MessageBox.Show("没有查询到数据!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
        }
        private void _query_Click(object sender, RoutedEventArgs e)
        {
            string company_name = _company_name.Text;

            System.Data.DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_query_company('{0}','{1}','{2}','{3}','{4}','{5}')",
                                                                                             (Application.Current.Resources["User"] as UserInfo).ID,
                                                                                             _province1.SelectedIndex < 1 ? "" : (_province1.SelectedItem as Label).Tag,
                                                                                             _city1.SelectedIndex < 1 ? "" : (_city1.SelectedItem as Label).Tag,
                                                                                             _region1.SelectedIndex < 1 ? "" : (_region1.SelectedItem as Label).Tag,
                                                                                             _detect_dept.SelectedIndex < 1 ? "" : (_detect_dept.SelectedItem as Label).Tag,
                                                                                             company_name)).Tables[0];


            lvlist.DataContext = table;
            exporttable        = table;

            _sj.Visibility = Visibility.Visible;
            _hj.Visibility = Visibility.Visible;
            _title.Text    = table.Rows.Count.ToString();

            if (table.Rows.Count == 0)
            {
                Toolkit.MessageBox.Show("没有查询到数据!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
        }
        public CertificatePreview(IDBOperation dbOperation,string card_id)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            this.cardId = card_id;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_certificate_main('{0}')", cardId)).Tables[0];
            if (table.Rows.Count > 0)
            {
                _card_id.Text = table.Rows[0][0].ToString();
                _company.Text = table.Rows[0][2].ToString();
                _phone.Text = table.Rows[0][6].ToString();
                _detect_object.Text = table.Rows[0][4].ToString();
                _object_count.Text = table.Rows[0][5].ToString();
                _for_use.Text = table.Rows[0][7].ToString();
                _city_ks.Text = table.Rows[0][8].ToString();
                _region_ks.Text= table.Rows[0][9].ToString();
                _town_ks.Text= table.Rows[0][10].ToString();
                _village_ks.Text = table.Rows[0][11].ToString();
                _city_js.Text = table.Rows[0][12].ToString();
                _region_js.Text = table.Rows[0][13].ToString();
                _town_js.Text = table.Rows[0][14].ToString();
                _village_js.Text = table.Rows[0][15].ToString();
                _object_lable.Text = table.Rows[0][16].ToString();
                _user_name.Text = table.Rows[0][17].ToString();
                _user_id.Text = table.Rows[0][21].ToString();
                _nian.Text = ConvertStr.convert_nian(table.Rows[0][18].ToString());
                _yue.Text = ConvertStr.convert_yue(table.Rows[0][19].ToString());
                _day.Text = ConvertStr.convert_day(table.Rows[0][20].ToString());
            }
        }
        public CertificateProductPreview(IDBOperation dbOperation, string card_id)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            this.cardId = card_id;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_certificate_product_main('{0}')", cardId)).Tables[0];
            if (table.Rows.Count > 0)
            {
                _card_id.Text = table.Rows[0][0].ToString();
                _company.Text = table.Rows[0][2].ToString();
                _product_name.Text = table.Rows[0][4].ToString();
                _object_count.Text = table.Rows[0][5].ToString();
                _cz_cardid.Text = table.Rows[0][3].ToString();
                _product_area.Text = table.Rows[0][6].ToString();
                _dept_name.Text = table.Rows[0][7].ToString() + "              " + table.Rows[0][8].ToString();
                _mdd.Text = table.Rows[0][9].ToString();
                _bz.Text = table.Rows[0][10].ToString();
                _user_name.Text = table.Rows[0][11].ToString();
                _user_id.Text = table.Rows[0][15].ToString();
                _nian.Text = ConvertStr.convert_nian(table.Rows[0][12].ToString());
                _yue.Text = ConvertStr.convert_yue(table.Rows[0][13].ToString());
                _day.Text = ConvertStr.convert_day(table.Rows[0][14].ToString());
            }
        }
        public SysTrendAnalysis(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            DataTable     table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_year_count({0})", (Application.Current.Resources["User"] as UserInfo).ID)).Tables[0];
            List <string> years = new List <string>();

            years.Add("-请选择-");
            for (int i = 0; i < table.Rows.Count; i++)
            {
                years.Add(table.Rows[i][0].ToString());
            }

            _year.ItemsSource   = years;
            _year.SelectedIndex = 0;

            List <string> analysisThemes = new List <string>();

            analysisThemes.Add("-请选择-");
            analysisThemes.Add("年度各项目检测执行趋势分析");
            analysisThemes.Add("年度各检测项目阳性样本检出趋势分析");
            analysisThemes.Add("年度各检测项目疑似阳性样本检出趋势分析");
            _analysis_theme.ItemsSource   = analysisThemes;
            _analysis_theme.SelectedIndex = 0;

            this.SizeChanged   += new SizeChangedEventHandler(SysTrendAnalysis_SizeChanged);
            _chart.SizeChanged += new SizeChangedEventHandler(_chart_SizeChanged);
        }
            "第四季度"};//初始化变量

        public SysQuarterAnalysis(IDBOperation dbOperation)
        {

            InitializeComponent();
            this.dbOperation = dbOperation;
            user_id = (Application.Current.Resources["User"] as UserInfo).ID.ToString();

            _year.ItemsSource = year;
            for (int i = 0; i < _year.Items.Count; i++)
            {
                if (_year.Items[i].ToString() == DateTime.Now.Year.ToString())

                {
                    _year.SelectedItem = _year.Items[i];
                    break;
                }
            }

            _month.ItemsSource = month;
            _month.SelectedIndex = 2;

            ComboboxTool.InitComboboxSource(_detect_huanjie, "SELECT id,name FROM t_liaoning_huanjie", "cxtj");

            //地址从数据库中获取
            page_url = dbOperation.GetDbHelper().GetSingle("select quarterreport from t_url ").ToString();
            if (page_url == null)
            {
                page_url = "";
            }
        }
        public SysDeptManager(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            ProvinceCityTable = System.Windows.Application.Current.Resources["省市表"] as System.Data.DataTable;
            user_flag_tier = (System.Windows.Application.Current.Resources["User"] as UserInfo).FlagTier.ToString();
            SupplierTable = dbOperation.GetDbHelper().GetDataSet("select supplierId,supplierName from t_supplier").Tables[0];
            //赋值所在地下拉选择框
            ComboboxTool.InitComboboxSource(_lower_provice, GetRows("0001"), "lr");
            _lower_provice.SelectionChanged += new SelectionChangedEventHandler(_province_SelectionChanged);
            //赋值供应商下拉选择框
            ComboboxTool.InitComboboxSource(_Supplier, "select supplierId,supplierName from t_supplier", "lr");
            //赋值部门级别下拉选择框
            dt_level.Columns.Add(new DataColumn("levelid"));
            dt_level.Columns.Add(new DataColumn("levelname"));
            var row2 = dt_level.NewRow();
            row2["levelid"] = "1";
            row2["levelname"] = "省级";
            dt_level.Rows.Add(row2);
            var row3 = dt_level.NewRow();
            row3["levelid"] = "2";
            row3["levelname"] = "市(州)";
            dt_level.Rows.Add(row3);
            var row4 = dt_level.NewRow();
            row4["levelid"] = "3";
            row4["levelname"] = "区县";
            dt_level.Rows.Add(row4);
            var row5 = dt_level.NewRow();
            row5["levelid"] = "4";
            row5["levelname"] = "检测单位";
            dt_level.Rows.Add(row5);
            ComboboxTool.InitComboboxSource(_level, dt_level, "lr");

            InitUserControlUI();
        }
        };          //初始化变量

        public SysQuarterAnalysis(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            user_id          = (Application.Current.Resources["User"] as UserInfo).ID.ToString();

            _year.ItemsSource = year;
            for (int i = 0; i < _year.Items.Count; i++)
            {
                if (_year.Items[i].ToString() == DateTime.Now.Year.ToString())

                {
                    _year.SelectedItem = _year.Items[i];
                    break;
                }
            }

            _month.ItemsSource   = month;
            _month.SelectedIndex = 2;

            ComboboxTool.InitComboboxSource(_detect_huanjie, "SELECT id,name FROM t_liaoning_huanjie", "cxtj");

            //地址从数据库中获取
            page_url = dbOperation.GetDbHelper().GetSingle("select quarterreport from t_url ").ToString();
            if (page_url == null)
            {
                page_url = "";
            }
        }
 public AddShipper(IDBOperation dbOperation, string shipperflag)
 {
     InitializeComponent();
     this.dbOperation = dbOperation;
     this.shipperFlag = shipperflag;
     this._id.Text    = dbOperation.GetDbHelper().GetSingle(string.Format("select f_create_shipper('{0}')", shipperFlag)).ToString();
 }
        public detectdetails(IDBOperation dbOperation,int id)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details_sc('{0}')",id)).Tables[0];

            //给画面上的控件赋值
            _orderid.Text = table.Rows[0][15].ToString();
            _areaName.Text = table.Rows[0][8].ToString();
            _companyName.Text = table.Rows[0][9].ToString();
            _itemName.Text = table.Rows[0][3].ToString();
            _objectName.Text = table.Rows[0][4].ToString();
            _reangetName.Text = table.Rows[0][5].ToString();
            _resultName.Text = table.Rows[0][6].ToString();
            _deptName.Text = table.Rows[0][2].ToString();
            _detectDate.Text = table.Rows[0][1].ToString();
            _detectUserName.Text = table.Rows[0][7].ToString();
            _detectTypeName.Text = table.Rows[0][0].ToString();
            _detectvalue.Text = table.Rows[0][18].ToString();

            //检测结果为疑似阳性变红
            if (_resultName.Text == "疑似阳性" || _resultName.Text == "确证阳性")
            {
                _resultName.Foreground = Brushes.Red;
            }
            else
            {
                _resultName.Foreground = Brushes.Black;
            }
        }
Exemple #39
0
 public AddShipper(IDBOperation dbOperation,string shipperflag)
 {
     InitializeComponent();
     this.dbOperation = dbOperation;
     this.shipperFlag = shipperflag;
     this._id.Text = dbOperation.GetDbHelper().GetSingle(string.Format("select f_create_shipper('{0}')", shipperFlag)).ToString();
    
 }
        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 SysDeptManager(IDBOperation dbOperation)
 {
     InitializeComponent();
     this.dbOperation = dbOperation;
     ProvinceCityTable = System.Windows.Application.Current.Resources["省市表"] as System.Data.DataTable;
     user_flag_tier = (System.Windows.Application.Current.Resources["User"] as UserInfo).FlagTier.ToString();
     SupplierTable = dbOperation.GetDbHelper().GetDataSet("select supplierId,supplierName from t_supplier").Tables[0];
     InitUserControlUI();
 }
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_user_sign_details('{0}','{1}','{2}',{3},{4})",
                                                                                 Kssj, Jssj, UserId,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
        }
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_certificate_product_details('{0}',{1},{2})",
                                                                                 CzCardId,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
        }
Exemple #44
0
        private void GetData()
        {
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_warning_details_new('{0}','{1}','{2}',{3},{4})",
                                                                                 DeptId, ItemId, ObjectId,
                                                                                 (_tableview.PageIndex - 1) * _tableview.RowMax,
                                                                                 _tableview.RowMax)).Tables[0];

            _tableview.Table = table;
        }
        public UcCreateCertificate(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;

            _user_name.Text = username;
            _user_id.Text = loginid;
            _nian.Text = ConvertStr.convert_nian(DateTime.Now.Year.ToString());
            _yue.Text = ConvertStr.convert_yue(DateTime.Now.Month.ToString());
            _day.Text = ConvertStr.convert_day(DateTime.Now.Day.ToString());

            //出证人所属的市级单位,及出证人所属部门货主信息flag,赋值启运地点
            DataTable table = dbOperation.GetDbHelper().GetDataSet("select sys_city.name as city,ifnull(a.shipperflag,'') as shipperflag," +
                                    " tzcname,tzcarea,tzcaddress" +
                                    " from sys_client_sysdept a LEFT JOIN sys_city ON a.city = sys_city.id" +
                                    " where INFO_CODE = " + deptId).Tables[0];
            if(table.Rows.Count != 0)
            {
                cityname = table.Rows[0][0].ToString();
                shipperflag = table.Rows[0][1].ToString();

                string tzcarea = table.Rows[0][3].ToString();

                _city_ks.Text = tzcarea.Substring(0,2).ToString();
                _region_ks.Text = tzcarea.Substring(3, 3).ToString();
                //_town_ks.Text = table.Rows[0][4].ToString();
                _village_ks.Text = table.Rows[0][2].ToString();
            }            

            //检疫证号
            string card_id = dbOperation.GetDbHelper().GetSingle(string.Format("select f_get_cardid('{0}')", deptId)).ToString();
            _card_id.Text = card_id;
            //协检员
            ComboboxTool.InitComboboxSource(_help_user, string.Format("call p_user_helpuser({0})", userId), "lr");
            //动物种类
            ComboboxTool.InitComboboxSource(_object_id, "SELECT animalid,animalname FROM t_animal_new WHERE openflag = '1' and deptflag = '" + shipperflag + "'", "lr");
            _object_id.SelectionChanged += new SelectionChangedEventHandler(_object_id_SelectionChanged);
            _object_id.SelectedIndex = 1;
            //用途
            ComboboxTool.InitComboboxSource(_for_use, "SELECT useid,usename FROM t_for_use WHERE openflag = '1'", "lr");
            _for_use.SelectedIndex = 1;
        }
        public userSignMap(IDBOperation dbOperation, int id)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;
            this.Id = id;

            //图片地址改为从数据库中获取
            string picture_url = dbOperation.GetDbHelper().GetSingle("select pictureurl from t_url ").ToString();
            if (picture_url == "")
            {
                picture_url = "http://www.zrodo.com:8080/xmjc/";
            }

            string url = dbOperation.GetDbHelper().GetSingle(string.Format("select url from sys_sign_in where id = '{0}'", Id)).ToString();
            if (url != "" )
            {
                _img.Source = new BitmapImage(new Uri(picture_url + url));
            }
        }
        public SysShipperQuery(IDBOperation dbOperation)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;
            deptId = (System.Windows.Application.Current.Resources["User"] as UserInfo).DepartmentID;

            shipperflag = dbOperation.GetDbHelper().GetSingle("select ifnull(a.shipperflag,'') as shipperflag " +
                                    " from sys_client_sysdept a " +
                                    " where INFO_CODE = " + deptId).ToString();
        }
        public detectDetailsReview(IDBOperation dbOperation, int id)
        {
            InitializeComponent();

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

            orderid = id;

            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details_sc('{0}')", id)).Tables[0];

            //给画面上的控件赋值
            _orderid.Text = table.Rows[0][15].ToString();
            _areaName.Text = table.Rows[0][8].ToString();
            _companyName.Text = table.Rows[0][9].ToString();
            _itemName.Text = table.Rows[0][3].ToString();
            _objectName.Text = table.Rows[0][4].ToString();
            _reangetName.Text = table.Rows[0][5].ToString();
            _resultName.Text = table.Rows[0][6].ToString();
            _deptName.Text = table.Rows[0][2].ToString();
            _detectDate.Text = table.Rows[0][1].ToString();
            _detectUserName.Text = table.Rows[0][7].ToString();
            _detectTypeName.Text = table.Rows[0][0].ToString();
            _detectvalue.Text = table.Rows[0][18].ToString();
            _reviewBz.Text = table.Rows[0][16].ToString();
            _reviewUserid.Text = table.Rows[0][11].ToString();
            _reviewReagent_text.Text = table.Rows[0][12].ToString();
            _reviewResult_text.Text = table.Rows[0][13].ToString();
            _reviewDate.Text = table.Rows[0][14].ToString();

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

            if(table.Rows[0][17].ToString() == "0")
            {
                _result_id.Text = "检测卡假阳性";
            }
            else if (table.Rows[0][19].ToString() == "1")
            {
                _result_id.Text = "确证阳性";
            }
            else
            {
                _result_id.Text = "";
            }
        }
 public UcUserManager(IDBOperation dbOperation)
 {
     InitializeComponent();
     this.dbOperation = dbOperation;
     ProvinceCityTable = Application.Current.Resources["省市表"] as DataTable;
     user_flag_tier = (Application.Current.Resources["User"] as UserInfo).FlagTier.ToString();
     SupplierTable = dbOperation.GetDbHelper().GetDataSet("select supplierId,supplierName from t_supplier").Tables[0];
     this.Loaded += new RoutedEventHandler(Load_DeptManager);
     //用户管理的初始化
     ComboboxTool.InitComboboxSource(_department, "select INFO_CODE,INFO_NAME from sys_client_sysdept", "lr");
     ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role", "lr");
     _department.SelectionChanged += new SelectionChangedEventHandler(_department_SelectionChanged);
 }
        public UcCreateCertificate_product(IDBOperation dbOperation)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;
            _user_name.Text = username;
            _user_id.Text = loginid;
            _nian.Text = ConvertStr.convert_nian(DateTime.Now.Year.ToString());
            _yue.Text = ConvertStr.convert_yue(DateTime.Now.Month.ToString());
            _day.Text = ConvertStr.convert_day(DateTime.Now.Day.ToString());

            //出证人所属部门货主信息flag,生产单位信息
            DataTable table = dbOperation.GetDbHelper().GetDataSet("select ifnull(a.shipperflag,'') as shipperflag, " +
                                    " tzcname,tzcarea,tzcaddress,tzccardid "+
                                    " from sys_client_sysdept a " +
                                    " where INFO_CODE = " + deptId ).Tables[0];

            if (table.Rows.Count != 0)
            {
                shipperflag = table.Rows[0][0].ToString();
                _dept_area.Text = table.Rows[0][2].ToString();
                _dept_address.Text = table.Rows[0][3].ToString();
                _dept_name.Text = table.Rows[0][1].ToString();
                _cz_cardid.Text = table.Rows[0][4].ToString();
            }

            //产品检疫证号
            string product_cardid = dbOperation.GetDbHelper().GetSingle(string.Format("select f_get_productcardid('{0}')", deptId)).ToString();
            _card_id.Text = product_cardid;
            //协检员
            ComboboxTool.InitComboboxSource(_help_user, string.Format("call p_user_helpuser({0})", userId), "lr");
            //产品名称
            ComboboxTool.InitComboboxSource(_product_name, "SELECT productid,productname FROM t_product WHERE openflag = '1' and deptflag = '" + shipperflag + "'", "lr");
            _product_name.SelectionChanged += new SelectionChangedEventHandler(_product_name_SelectionChanged);
            _product_name.SelectedIndex = 1;
            //生产单位
            //ComboboxTool.InitComboboxSource(_dept_name, string.Format("call p_get_dept_tz({0})", userId), "lr");
            //_dept_name.SelectionChanged += new SelectionChangedEventHandler(_dept_name_SelectionChanged);
        }
        public UcInnocentTreatmentRecord(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;

            //检疫员所属部门货主信息flag,屠宰场名称,检疫分站名称
            DataTable table = dbOperation.GetDbHelper().GetDataSet("select ifnull(a.shipperflag,'') as shipperflag, " +
                                    " tzcname,INFO_NAME" +
                                    " from sys_client_sysdept a " +
                                    " where INFO_CODE = " + deptId).Tables[0];

            if (table.Rows.Count != 0)
            {
                shipperflag = table.Rows[0][0].ToString();
                _detect_site.Text = table.Rows[0][2].ToString();
                _slaughter_site.Text = table.Rows[0][1].ToString();
            }
            //申报人姓名
            ComboboxTool.InitComboboxSource(_shipper_name, string.Format("SELECT sbrid,sbrname FROM t_record_sbr WHERE openflag = '1' and createdeptid = '{0}'", deptId), "lr");
            //产地
            ComboboxTool.InitComboboxSource(_address, string.Format("SELECT areaid,areaname FROM t_record_area WHERE openflag = '1' and createdeptid = '{0}'", deptId), "lr");
            //协检员
            ComboboxTool.InitComboboxSource(_help_user, string.Format("call p_user_helpuser({0})", userId), "lr");
            //官方兽医姓名
            _user_name.Text = username;
            //录入时间
            _entering_datetime.Text = string.Format("{0:g}", System.DateTime.Now);
            //无害化处理方式
            ComboboxTool.InitComboboxSource(_function_zq, string.Format("select functionid,functionname from t_function where openflag = '1'"), "lr");
            ComboboxTool.InitComboboxSource(_function_tb, string.Format("select functionid,functionname from t_function where openflag = '1'"), "lr");

            //单位
            DataTable dt_type = dbOperation.GetDbHelper().GetDataSet("select animalid,unit from t_animal_new where deptflag =" + shipperflag).Tables[0];
            _object_type_zq.Text = dt_type.Rows[0][1].ToString();
            _object_type_tb.Text = dt_type.Rows[0][1].ToString();
            _object_type_san.Text = "公斤";
        }
            "2020"};//初始化变量


        public SysYearAnalysis(IDBOperation dbOperation)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            user_id = (Application.Current.Resources["User"] as UserInfo).ID.ToString();

            _year.ItemsSource = year;
            _year.SelectedIndex = 1;

            //地址从数据库中获取
            page_url = dbOperation.GetDbHelper().GetSingle("select yearreport from t_url ").ToString();
            if (page_url == null)
            {
                page_url = "";
            }
        }
        public ModifyShipper_product(IDBOperation dbOperation, string shipper_id,string shipperflag, SysShipperQuery_product ship_query)
        {
            InitializeComponent();
            this.dbOperation = dbOperation;
            this.shipperId = shipper_id;
            this._id.Text = shipperId;
            this.ship = ship_query;
            this.shipperFlag = shipperflag;
            DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("select shippername,phone,address from t_shipper_product " +
                               "where shipperid = '{0}' and shipperflag = '{1}'", shipperId, shipperFlag)).Tables[0];
            if (table.Rows.Count != 0)
            {
                this._name.Text = table.Rows[0][0].ToString();
                this._phone.Text = table.Rows[0][1].ToString();
                this._address.Text = table.Rows[0][2].ToString();
            }

        }
        public AddReviewDetails(IDBOperation dbOperation, int id,SysReviewInfoSc sysreviewinfosc)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;
            this.sysreviewinfosc = sysreviewinfosc;
            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_sc('{0}')", id)).Tables[0];

            //给画面上的控件赋值
            _orderid.Text = table.Rows[0][15].ToString();
            _areaName.Text = table.Rows[0][8].ToString();
            _companyName.Text = table.Rows[0][9].ToString();
            _itemName.Text = table.Rows[0][3].ToString();
            _objectName.Text = table.Rows[0][4].ToString();
            _reangetName.Text = table.Rows[0][5].ToString();
            _resultName.Text = table.Rows[0][6].ToString();
            _deptName.Text = table.Rows[0][2].ToString();
            _detectDate.Text = table.Rows[0][1].ToString();
            _detectUserName.Text = table.Rows[0][7].ToString();
            _detectTypeName.Text = table.Rows[0][0].ToString();
            _detectvalue.Text = table.Rows[0][18].ToString();

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


            _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");

        }
        public SetTaskGrade(IDBOperation dbOperation, string grade_id, string dept_id, DataTable current_table,SysTaskCheck systaskcheck)
        {
            InitializeComponent();

            this.dbOperation = dbOperation;

            this.systaskcheck = systaskcheck; 

            gradeId = grade_id;

            deptId = dept_id;

            currentTable = current_table;

            string grade_up;
            string grade_down;

            switch (gradeId)
            {
                case "1": _grade_up.Text = "100";
                    _grade_up.IsEnabled = false;
                    break;
                case "2": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID,"1")).ToString();
                    grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "3")).ToString();
                    _grade_up.Text = grade_up;
                    _grade_down.Text = grade_down;
                    break;
                case "3": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "2")).ToString();
                    grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "4")).ToString();
                    _grade_up.Text = grade_up;
                    _grade_down.Text = grade_down;
                    break;
                case "4": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "3")).ToString();
                    grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "5")).ToString();
                    _grade_up.Text = grade_up;
                    _grade_down.Text = grade_down;
                    break;
                case "5": _grade_down.Text = "0";
                    _grade_down.IsEnabled = false;
                    break;
                default: break;
            }
        }
        public MainWindowTradition(IDBOperation dbOperation)
        {
            InitializeComponent();

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

            //系统标题的显示
            string sql = string.Format("select title from sys_client_sysdept where INFO_CODE = '{0}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID);
            string title = dbOperation.GetDbHelper().GetSingle(sql).ToString();

            this.Title = title + "              "+"当前登录用户:" + (Application.Current.Resources["User"] as UserInfo).ShowName;

            Application.Current.Resources.Add("省市表", dbOperation.GetProvinceCity());
            MenuRole();
            foreach (FatherMenuTitle fatherMenuTitle in menuTitles)
            {
                MenuItem fatherMenu = new MenuItem();
                fatherMenu.FontSize = 16;
                fatherMenu.Header = fatherMenuTitle.Name;
                if (fatherMenuTitle.ChildMenuTitle.Count == 0)
                {
                    fatherMenu.Click += new RoutedEventHandler(childMenu_Click);
                }
                else
                {
                    foreach (string childMenuTitle in fatherMenuTitle.ChildMenuTitle)
                    {
                        MenuItem childMenu = new MenuItem();
                        childMenu.FontSize = 16;
                        childMenu.Header = childMenuTitle;
                        childMenu.Click += new RoutedEventHandler(childMenu_Click);
                        fatherMenu.Items.Add(childMenu);
                    }
                }
                _menu.Items.Add(fatherMenu);
            }

            mainPage = new UcMainPage();
            grid_Component.Children.Add(mainPage);

            this.WindowState = WindowState.Maximized;
        }
        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;
            }

        }