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 UcDetectBillManager() { InitializeComponent(); dbOperation = DBUtility.DbHelperMySQL.CreateDbHelper(); ProvinceCityTable = Application.Current.Resources["省市表"] as DataTable; DataRow[] rows = ProvinceCityTable.Select("pid = '0001'"); //画面初始化-新增检测单画面 ComboboxTool.InitComboboxSource(_province, rows,"lr"); _province.SelectionChanged += new SelectionChangedEventHandler(_province_SelectionChanged); ComboboxTool.InitComboboxSource(_source_company, "SELECT COMPANYID,COMPANYNAME FROM v_user_company WHERE userid = " + userId,"lr"); if (supplierId == "nkrx") { ComboboxTool.InitComboboxSource(_detect_trade, "select tradeId,tradeName from t_trade where openFlag = '1' order by orderId", "lr"); } else { ComboboxTool.InitComboboxSource(_detect_trade, "select tradeId,tradeName from t_trade where openFlag = '1'", "lr"); } _detect_trade.SelectionChanged += new SelectionChangedEventHandler(_detect_trade_SelectionChanged); //ComboboxTool.InitComboboxSource(_detect_item, "SELECT itemid,ItemNAME FROM v_user_item WHERE userid = " + userId); //ComboboxTool.InitComboboxSource(_detect_object, " SELECT objectId,objectName FROM v_user_object WHERE userid = " + userId); //ComboboxTool.InitComboboxSource(_detect_sample, " SELECT sampleId,sampleName FROM v_user_sample WHERE userid = " + userId); //ComboboxTool.InitComboboxSource(_detect_sensitivity, "SELECT sensitivityId,sensitivityName FROM t_det_sensitivity where openFlag = '1'", "lr"); ComboboxTool.InitComboboxSource(_detect_result, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr"); _entering_datetime.Text = string.Format("{0:g}", System.DateTime.Now); _source_company.SelectionChanged += new SelectionChangedEventHandler(_source_company_SelectionChanged); _detect_person.Text = (Application.Current.Resources["User"] as UserInfo).ShowName; _detect_site.Text = dbOperation.GetSingle("SELECT INFO_NAME from sys_client_sysdept WHERE INFO_CODE = " + (Application.Current.Resources["User"] as UserInfo).DepartmentID).ToString(); }
public UcDetectBillManager() { InitializeComponent(); dbOperation = DBUtility.DbHelperMySQL.CreateDbHelper(); ProvinceCityTable = Application.Current.Resources["省市表"] as DataTable; DataTable table = dbOperation.GetDataSet("select proviceid as id , name " + "from t_set_area LEFT JOIN sys_city ON t_set_area.proviceid = sys_city.id " + "where deptid = " + deptid).Tables[0]; DataRow[] rows; if (table.Rows.Count == 0) { rows = ProvinceCityTable.Select("pid = '0001'"); } else { rows = table.Select(); } //画面初始化-新增检测单画面 ComboboxTool.InitComboboxSource(_province, rows,"lr"); _province.SelectionChanged += new SelectionChangedEventHandler(_province_SelectionChanged); //查找登录者部门所属的省份 string proviceid = dbOperation.GetSingle("select province from sys_client_sysdept where INFO_CODE = " + deptid).ToString(); int i = 1; foreach(DataRow row in rows) { if (row["id"].ToString() == proviceid) { _province.SelectedIndex = i; } i = i + 1; } ComboboxTool.InitComboboxSource(_source_company, "SELECT COMPANYID,COMPANYNAME FROM v_user_company WHERE userid = " + userId, "lr"); //if (supplierId == "nkrx") //{ // ComboboxTool.InitComboboxSource(_detect_trade, "select tradeId,tradeName from t_trade where openFlag = '1' order by orderId", "lr"); //} //else //{ // ComboboxTool.InitComboboxSource(_detect_trade, "select tradeId,tradeName from t_trade where openFlag = '1'", "lr"); //} //_detect_trade.SelectionChanged += new SelectionChangedEventHandler(_detect_trade_SelectionChanged); //_detect_trade.SelectedIndex = 1; //ComboboxTool.InitComboboxSource(_detect_item, "SELECT itemid,ItemNAME FROM v_user_item WHERE userid = " + userId); //ComboboxTool.InitComboboxSource(_detect_object, " SELECT objectId,objectName FROM v_user_object WHERE userid = " + userId); //ComboboxTool.InitComboboxSource(_detect_sample, " SELECT sampleId,sampleName FROM v_user_sample WHERE userid = " + userId); //ComboboxTool.InitComboboxSource(_detect_sensitivity, "SELECT sensitivityId,sensitivityName FROM t_det_sensitivity where openFlag = '1'", "lr"); ComboboxTool.InitComboboxSource(_detect_item, string.Format("SELECT ItemID,ItemNAME FROM t_det_item WHERE (tradeId ='1'or ifnull(tradeId,'') = '') and OPENFLAG = '1' order by orderId"), "lr"); _detect_item.SelectionChanged += new SelectionChangedEventHandler(_detect_item_SelectionChanged); ComboboxTool.InitComboboxSource(_detect_result, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr"); ComboboxTool.InitComboboxSource(_card_brand, "SELECT cardbrandid,cardbrandname FROM t_cardbrand where openFlag = '1'", "lr"); _entering_datetime.Text = string.Format("{0:g}", System.DateTime.Now); _source_company.SelectionChanged += new SelectionChangedEventHandler(_source_company_SelectionChanged); _detect_person.Text = (Application.Current.Resources["User"] as UserInfo).ShowName; _detect_site.Text = dbOperation.GetSingle("SELECT INFO_NAME from sys_client_sysdept WHERE INFO_CODE = " + (Application.Current.Resources["User"] as UserInfo).DepartmentID).ToString(); }
public UcMainPage() { InitializeComponent(); dbOperation = DBUtility.DbHelperMySQL.CreateDbHelper(); //首页地址改为从数据库中获取 string page_url = dbOperation.GetSingle("select firstpageurl from t_url ").ToString(); if (page_url == "") { page_url = "http://www.zrodo.com:8040/ulsocialevent/getMapTesttt.do?user_id={0}"; } _webBrowser.Source = new Uri(string.Format(page_url, (Application.Current.Resources["User"] as UserInfo).ID)); // _webBrowser.Source = new Uri(string.Format("http://www.zrodo.com:8040/ulsocialevent/getMapTesttt.do?user_id={0}", (Application.Current.Resources["User"] as UserInfo).ID)); }
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 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; } }