void _department_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_department.SelectedIndex > 0) { switch (dept_flag) { case "0": _cmbRoleType.IsEnabled = true; ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where NUMB_ROLE =1", "lr"); break; case "1": _cmbRoleType.IsEnabled = true; ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where NUMB_ROLE = 79", "lr"); break; case "2": _cmbRoleType.IsEnabled = true; ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where NUMB_ROLE = 76", "lr"); break; case "3": _cmbRoleType.IsEnabled = true; ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where NUMB_ROLE = 77 or NUMB_ROLE = 80", "lr"); break; case "4": _cmbRoleType.IsEnabled = true; ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where NUMB_ROLE = 60 or NUMB_ROLE = 50 or NUMB_ROLE = 51", "lr"); break; default: break; } _cmbRoleType.SelectionChanged += new SelectionChangedEventHandler(_cmbRoleType_SelectionChanged); } }
public UcDetectInquire(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; ProvinceCityTable = Application.Current.Resources["省市表"] as DataTable; DataRow[] rows = ProvinceCityTable.Select("pid = '0001'"); //画面初始化-检测单列表画面 dtpStartDate.Value = DateTime.Now.AddDays(-1); dtpEndDate.Value = DateTime.Now; ComboboxTool.InitComboboxSource(_source_company1, string.Format(" call p_user_company('{0}') ", userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_station, string.Format("call p_user_dept('{0}')", userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_item1, "SELECT ItemID,ItemNAME FROM t_det_item WHERE (tradeId ='1'or tradeId ='2' or tradeId ='3' or ifnull(tradeId,'') = '') and OPENFLAG = '1' order by orderId", "cxtj"); ComboboxTool.InitComboboxSource(_detect_object1, "SELECT objectId,objectName FROM t_det_object WHERE (tradeId ='1'or tradeId ='2' or tradeId ='3' or ifnull(tradeId,'') = '') and OPENFLAG = '1'", "cxtj"); ComboboxTool.InitComboboxSource(_detect_result1, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "cxtj"); ComboboxTool.InitComboboxSource(_detect_person1, string.Format("call p_user_detuser('{0}')", userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_method, "select reagentId,reagentName from t_det_reagent where openFlag = '1'", "cxtj"); ComboboxTool.InitComboboxSource(_detect_type, "SELECT sourceId,sourceName FROM t_det_source where openFlag = '1'", "cxtj"); ComboboxTool.InitComboboxSource(_dept_type, "SELECT typeId,typeName FROM t_dept_type where openFlag = '1'", "cxtj"); ComboboxTool.InitComboboxSource(_province1, rows, "cxtj"); _province1.SelectionChanged += new SelectionChangedEventHandler(_province1_SelectionChanged); SetColumns(); }
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(); }
void _detect_item_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_detect_item.SelectedIndex > 0) { ComboboxTool.InitComboboxSource(_detect_sensitivity, operationContract.GetComboExecuteProDetect("f", (_detect_item.SelectedItem as Label).Tag, (_detect_object.SelectedItem as Label).Tag), "lr"); } }
public SysDesignReport(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; reportDate_kssj.Value = DateTime.Now.AddDays(-1); reportDate_jssj.Value = DateTime.Now; //检测站点 ComboboxTool.InitComboboxSource(_detect_dept, "call p_user_dept(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测点属性 ComboboxTool.InitComboboxSource(_detect_type, "SELECT typeId,typeName FROM t_dept_type where openFlag = '1'", "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, "call p_user_item(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测对象 ComboboxTool.InitComboboxSource(_detect_object, "call p_user_object(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测结果 ComboboxTool.InitComboboxSource(_detect_result, "SELECT resultId,resultName FROM t_det_result where openFlag='1' ORDER BY id", "cxtj"); //如果登录用户的部门是站点级别,则将查询条件检测站点赋上默认值 if (isDept()) { _detect_dept.SelectedIndex = 1; } SetColumns(); }
public SysCompanyQuery(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; ProvinceCityTable = Application.Current.Resources["省市表"] as DataTable; DataRow[] rows = ProvinceCityTable.Select("pid = '0001'"); user_flag_tier = (Application.Current.Resources["User"] as UserInfo).FlagTier; switch (user_flag_tier) { case "0": _dept_name.Text = "选择省:"; break; case "1": _dept_name.Text = "选择市(州):"; break; case "2": _dept_name.Text = "选择区县:"; break; case "3": _dept_name.Text = "选择检测单位:"; break; case "4": _dept_name.Text = "选择检测单位:"; break; default: break; } //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, "call p_dept_cxtj(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //来源产地 ComboboxTool.InitComboboxSource(_province1, rows, "cxtj"); _province1.SelectionChanged += new SelectionChangedEventHandler(_province1_SelectionChanged); }
public SysDayReport(string depttype) { InitializeComponent(); this.dept_type = depttype; user_flag_tier = PubClass.userInfo.FlagTier; reportDate.SelectedDate = DateTime.Now; //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, operationService.ExecuteProCxtj(PubClass.userInfo.ID), "cxtj"); //检测结果 ComboboxTool.InitComboboxSource(_detect_result, operationService.GetComboDetResult(), "cxtj"); //检测项目 switch (dept_type) { case "0": ComboboxTool.InitComboboxSource(_detect_item, operationService.GetComboDetItemProduce(), "cxtj"); break; case "1": ComboboxTool.InitComboboxSource(_detect_item, operationService.GetComboDetItemFishery(), "cxtj"); break; case "2": ComboboxTool.InitComboboxSource(_detect_item, operationService.GetComboDetItemAnimal(), "cxtj"); break; default: break; } //如果登录用户的部门是站点级别,则将查询条件检测单位赋上默认值 if (user_flag_tier == "4") { _detect_dept.SelectedIndex = 1; } _tableview.DetailsRowEnvent += new UcTableOperableView_NoPages.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
//20150707被检单位改为连动(受来源产地影响) void _region1_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_region1.SelectedIndex > 0) { ComboboxTool.InitComboboxSource(_source_company1, operationContract.ExecuteProUserCompany(userId, (_region1.SelectedItem as Label).Tag.ToString()), "cxtj"); } }
public SysNewDetectAnimalQuery() { InitializeComponent(); ProvinceCityTable = PubClass.ProvinceCityTable; DataRow[] rows = ProvinceCityTable.Select("pid = '0001'"); //画面初始化-检测单列表画面 dtpStartDate.SelectedDate = DateTime.Now.AddDays(-1); dtpEndDate.SelectedDate = DateTime.Now; ComboboxTool.InitComboboxSource(_source_company1, operationContract.ExecuteProUserCompany(userId, ""), "cxtj"); ComboboxTool.InitComboboxSource(_detect_station, operationContract.ExecuteProDetUser(userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_item1, operationContract.GetComboDetItemAnimal(), "cxtj"); ComboboxTool.InitComboboxSource(_detect_object1, operationContract.GetComboDetObjectAnimal(), "cxtj"); ComboboxTool.InitComboboxSource(_detect_result1, operationContract.GetComboDetResult(), "cxtj"); ComboboxTool.InitComboboxSource(_detect_person1, operationContract.ExecuteProDetUser(userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_method, operationContract.GetComboDetReagentAnimal(), "cxtj"); ComboboxTool.InitComboboxSource(_detect_type, operationContract.GetComboDetSource(), "cxtj"); ComboboxTool.InitComboboxSource(_province1, rows, "cxtj"); _province1.SelectionChanged += new SelectionChangedEventHandler(_province1_SelectionChanged); //20150707检测师改为连动(受监测站点影响) _detect_station.SelectionChanged += new SelectionChangedEventHandler(_detect_station_SelectionChanged); SetColumns(); }
}; //初始化变量 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 SysRoleManager() { InitializeComponent(); //赋值角色级别下拉选择框 dt_role_flag.Columns.Add(new DataColumn("levelid")); dt_role_flag.Columns.Add(new DataColumn("levelname")); var row2 = dt_role_flag.NewRow(); row2["levelid"] = "1"; row2["levelname"] = "省级"; dt_role_flag.Rows.Add(row2); var row3 = dt_role_flag.NewRow(); row3["levelid"] = "2"; row3["levelname"] = "市(州)"; dt_role_flag.Rows.Add(row3); var row4 = dt_role_flag.NewRow(); row4["levelid"] = "3"; row4["levelname"] = "区县"; dt_role_flag.Rows.Add(row4); var row5 = dt_role_flag.NewRow(); row5["levelid"] = "4"; row5["levelname"] = "检测单位"; dt_role_flag.Rows.Add(row5); ComboboxTool.InitComboboxSource(role_flag, dt_role_flag, "lr"); this.Loaded += new RoutedEventHandler(Test_Loaded); }
private void _tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { if ((_tabControl.SelectedItem as TabItem).Header.ToString() == "任务汇总表" && _tabControl.Tag.ToString() != "任务汇总表") { _tabControl.Tag = "任务汇总表"; loadTableView(); } else if ((_tabControl.SelectedItem as TabItem).Header.ToString() == "分配检测任务" && _tabControl.Tag.ToString() != "分配检测任务" && btnSave.Tag.ToString() != "修改") { _tabControl.Tag = "分配检测任务"; //_detect_trade.SelectionChanged -= new SelectionChangedEventHandler(_detect_trade_SelectionChanged); //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.SelectedIndex = 1; //_detect_trade.SelectionChanged += new SelectionChangedEventHandler(_detect_trade_SelectionChanged); _detect_station.SelectionChanged -= new SelectionChangedEventHandler(_detect_station_SelectionChanged); ComboboxTool.InitComboboxSource(_detect_station, string.Format("call p_user_dept_task('{0}','{1}')", PubClass.userInfo.ID, DateTime.Now.Year), "lr"); _detect_station.SelectionChanged += new SelectionChangedEventHandler(_detect_station_SelectionChanged); } }
void _detect_sensitivity_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_detect_sample.SelectedIndex > 0) { ComboboxTool.InitComboboxSource(_detect_sensitivity, string.Format("call p_detect_sensitivity( '{0}','{1}')", (_detect_item.SelectedItem as Label).Tag, (_detect_object.SelectedItem as Label).Tag), "lr"); } }
//20150707被检单位改为连动(受来源产地影响) void _region1_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_region1.SelectedIndex > 0) { ComboboxTool.InitComboboxSource(_source_company1, string.Format("call p_user_company('{0}','{1}')", userId, (_region1.SelectedItem as System.Windows.Controls.Label).Tag.ToString()), "cxtj"); } }
public SysDetectReport(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; ProvinceCityTable = System.Windows.Application.Current.Resources["省市表"] as System.Data.DataTable; DataRow[] rows = ProvinceCityTable.Select("pid = '0001'"); //画面初始化-检测单列表画面 dtpStartDate.SelectedDate = DateTime.Now.AddDays(-1); dtpEndDate.SelectedDate = DateTime.Now; ComboboxTool.InitComboboxSource(_source_company1, string.Format(" call p_user_company('{0}','') ", userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_station, string.Format("call p_user_dept('{0}')", userId), "cxtj"); ComboboxTool.InitComboboxSource(_detect_person1, string.Format("call p_user_detuser('{0}')", userId), "cxtj"); ComboboxTool.InitComboboxSource(_province1, rows, "cxtj"); _province1.SelectionChanged += new SelectionChangedEventHandler(_province1_SelectionChanged); //20150707检测师改为连动(受监测站点影响) _detect_station.SelectionChanged += new SelectionChangedEventHandler(_detect_station_SelectionChanged); //如果登录用户的部门是站点级别,则将查询条件检测单位赋上默认值 if (user_flag_tier == "4") { _detect_station.SelectedIndex = 1; } }
public SysCertificateYearReport(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; user_flag_tier = (Application.Current.Resources["User"] as UserInfo).FlagTier; user_id = (Application.Current.Resources["User"] as UserInfo).ID; dept_id = (Application.Current.Resources["User"] as UserInfo).DepartmentID; dtpStartDate.SelectedDate = DateTime.Now.AddDays(-1); dtpEndDate.SelectedDate = DateTime.Now; //switch (user_flag_tier) //{ // case "0": _dept_name.Text = "选择省:"; // dept_name = "省名称"; // break; // case "1": _dept_name.Text = "选择市(州):"; // dept_name = "市(州)单位名称"; // break; // case "2": _dept_name.Text = "选择区县:"; // dept_name = "区县名称"; // break; // case "3": _dept_name.Text = "选择检测单位:"; // dept_name = "检测单位名称"; // break; // case "4": _dept_name.Text = "选择检测单位:"; // dept_name = "检测单位名称"; // break; // default: break; //} //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, "call p_dept_cxtj(" + user_id + ")", "cxtj"); //电子证类型 DataTable dt_type = new DataTable(); dt_type.Columns.Add(new DataColumn("typeid")); dt_type.Columns.Add(new DataColumn("typename")); var row = dt_type.NewRow(); row["typeid"] = "0"; row["typename"] = "动物证"; dt_type.Rows.Add(row); var row2 = dt_type.NewRow(); row2["typeid"] = "1"; row2["typename"] = "产品证"; dt_type.Rows.Add(row2); ComboboxTool.InitComboboxSource(_cer_type, dt_type, "cxtj"); //如果登录用户的部门是站点级别,则将查询条件检测单位赋上默认值 if (user_flag_tier == "4") { _detect_dept.SelectedIndex = 1; } _tableview.DetailsRowEnvent += new UcTableOperableView_NoPages.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
void _detect_object_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_detect_object.SelectedIndex > 0) { ComboboxTool.InitComboboxSource(_detect_sample, string.Format("call p_detect_sample( '{0}','{1}')", userId, (_detect_object.SelectedItem as Label).Tag), "lr"); _detect_sample.SelectionChanged += new SelectionChangedEventHandler(_detect_sensitivity_SelectionChanged); } }
void Test_Loaded(object sender, RoutedEventArgs e) { BindData(); Clear(); ComboboxTool.InitComboboxSource(_department, "call p_dept_count(" + PubClass.userInfo.ID + ")", "lr"); ComboboxTool.InitComboboxSource(_cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role", "lr"); _department.SelectionChanged += new SelectionChangedEventHandler(_department_SelectionChanged); }
void Test_Loaded(object sender, RoutedEventArgs e) { BindData(); Clear(); ComboboxTool.InitComboboxSource(cmbRoleType, "SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where cuserid=" + (Application.Current.Resources["User"] as UserInfo).ID, "lr"); ComboboxTool.InitComboboxSource(_department, "call p_dept_count(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "lr"); }
void _city_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_city.SelectedIndex > 0) { DataRow[] rows = ProvinceCityTable.Select("pid = '" + (_city.SelectedItem as Label).Tag.ToString() + "'"); ComboboxTool.InitComboboxSource(_region, rows, "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('{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 SysMonthReport(string depttype) { InitializeComponent(); this.dept_type = depttype; user_flag_tier = PubClass.userInfo.FlagTier; _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; string month_Now = DateTime.Now.Month.ToString(); if (int.Parse(month_Now) < 10) { month_Now = "0" + month_Now; } for (int i = 0; i < _month.Items.Count; i++) { if (_month.Items[i].ToString() == month_Now) { _month.SelectedItem = _month.Items[i]; break; } } //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, operationService.ExecuteProCxtj(PubClass.userInfo.ID), "cxtj"); //检测结果 ComboboxTool.InitComboboxSource(_detect_result, operationService.GetComboDetResult(), "cxtj"); //检测项目 switch (dept_type) { case "0": ComboboxTool.InitComboboxSource(_detect_item, operationService.GetComboDetItemProduce(), "cxtj"); break; case "1": ComboboxTool.InitComboboxSource(_detect_item, operationService.GetComboDetItemFishery(), "cxtj"); break; case "2": ComboboxTool.InitComboboxSource(_detect_item, operationService.GetComboDetItemAnimal(), "cxtj"); break; default: break; } //如果登录用户的部门是站点级别,则将查询条件检测单位赋上默认值 if (user_flag_tier == "4") { _detect_dept.SelectedIndex = 1; } _tableview.DetailsRowEnvent += new UcTableOperableView_NoPages.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
void _detect_item_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_detect_item.SelectedIndex > 0) { //ComboboxTool.InitComboboxSource(_detect_object, string.Format("call p_detect_object( '{0}','{1}')", userId, (_detect_item.SelectedItem as Label).Tag), "lr"); ComboboxTool.InitComboboxSource(_detect_object, string.Format("SELECT objectId,objectName FROM v_item_object WHERE itemId = '{0}' and tradeId = '{1}'", (_detect_item.SelectedItem as Label).Tag, (_detect_trade.SelectedItem as Label).Tag), "lr"); _detect_object.SelectionChanged += new SelectionChangedEventHandler(_detect_object_SelectionChanged); } }
void _department_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_department.SelectedIndex > 0) { _cmbRoleType.IsEnabled = true; ComboboxTool.InitComboboxSource(_cmbRoleType, string.Format("SELECT NUMB_ROLE,INFO_NAME FROM sys_client_role where FLAG_TIER ='{0}'", dept_flag), "lr"); _cmbRoleType.SelectionChanged += new SelectionChangedEventHandler(_cmbRoleType_SelectionChanged); } }
void _province_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_province.SelectedIndex > 0) { DataRow[] rows = ProvinceCityTable.Select("pid = '" + (_province.SelectedItem as Label).Tag.ToString() + "'"); ComboboxTool.InitComboboxSource(_city, rows, "cxtj"); _city.SelectionChanged += new SelectionChangedEventHandler(_city_SelectionChanged); } }
void _province1_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_province1.SelectedIndex > 0) { DataRow[] rows = ProvinceCityTable.Select("pid = '" + (_province1.SelectedItem as Label).Tag.ToString() + "'"); ComboboxTool.InitComboboxSource(_city1, rows, "cxtj"); //20150707被检单位改为连动(受来源产地影响) ComboboxTool.InitComboboxSource(_source_company1, operationContract.ExecuteProUserCompany(userId, (_province1.SelectedItem as Label).Tag.ToString()), "cxtj"); _city1.SelectionChanged += new SelectionChangedEventHandler(_city1_SelectionChanged); } }
//20150707检测师改为连动(受检测单位影响) void _detect_station_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_detect_station.SelectedIndex > 0) { ComboboxTool.InitComboboxSource(_detect_person1, string.Format("SELECT RECO_PKID,INFO_USER,NUMB_USER FROM sys_client_user where fk_dept = '{0}'", (_detect_station.SelectedItem as System.Windows.Controls.Label).Tag.ToString()), "cxtj"); } else if (_detect_station.SelectedIndex == 0) { ComboboxTool.InitComboboxSource(_detect_person1, string.Format("call p_user_detuser('{0}')", userId), "cxtj"); } }
void _city1_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_city1.SelectedIndex > 0) { DataRow[] rows = ProvinceCityTable.Select("pid = '" + (_city1.SelectedItem as System.Windows.Controls.Label).Tag.ToString() + "'"); ComboboxTool.InitComboboxSource(_region1, rows, "cxtj"); //20150707被检单位改为连动(受来源产地影响) ComboboxTool.InitComboboxSource(_source_company1, string.Format(" call p_user_company('{0}','{1}') ", userId, (_city1.SelectedItem as System.Windows.Controls.Label).Tag.ToString()), "cxtj"); _region1.SelectionChanged += new SelectionChangedEventHandler(_region1_SelectionChanged); } }
void _department_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (_department.SelectedIndex > 0) { _cmbRoleType.IsEnabled = true; DataTable dt = operationService.GetRole(string.Format(" roleLevel='{0}'", dept_flag)); ComboboxTool.InitComboboxSource(_cmbRoleType, dt, "lr"); _cmbRoleType.SelectionChanged += new SelectionChangedEventHandler(_cmbRoleType_SelectionChanged); } }