}; //初始化变量 public SysMonthReport(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; _year.ItemsSource = year; _year.SelectedIndex = 5; _month.ItemsSource = month; _month.SelectedIndex = 3; //检测站点 ComboboxTool.InitComboboxSource(_detect_dept, "call p_user_dept(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, "call p_user_item(" + (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; } }
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"); 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(); }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (_province.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择省!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_city.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择市!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_region.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择区!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_source_company.SelectedIndex == 0 || _source_company.Text == "") { Toolkit.MessageBox.Show("请选择被检单位!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_number.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请输入检疫证号!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_object_count.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请输入批次头数!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_object_label.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请输入耳标号!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_object_label.Text.Trim().Length != 15) { Toolkit.MessageBox.Show("耳标号必须为15位!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_sample_no.SelectedIndex == 0 || _sample_no.Text == "") { Toolkit.MessageBox.Show("请选择样品编号!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_sample.SelectedIndex < 1) { Toolkit.MessageBox.Show("样品名称不能为空!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_object.SelectedIndex < 1) { Toolkit.MessageBox.Show("样品分类不能为空!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_item.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检查项目!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_method.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检测方法!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_sensitivity.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检测灵敏度!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_result.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检测结果!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_person.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请选择检测师!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } //判断被检单位是否存在,若不存在则插入数据库 string company_id = operationContract.GetCompanyId(_source_company.Text.Trim(), PubClass.userInfo.DepartmentID); if (string.IsNullOrEmpty(company_id)) { bool flag = operationContract.AddCompany(_source_company.Text, (_region.SelectedItem as Label).Tag.ToString(), "1", PubClass.userInfo.DepartmentID, PubClass.userInfo.ID, DateTime.Now); if (!flag) { Toolkit.MessageBox.Show("被检单位添加失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } } bool flag1 = detectContract.ExecuteProAddDetectAnimal(company_id, (_detect_item.SelectedItem as Label).Tag.ToString(), (_detect_method.SelectedItem as Label).Tag.ToString(), (_sample_no.SelectedItem as Label).Tag.ToString(), (_detect_object.SelectedItem as Label).Tag.ToString(), (_detect_sample.SelectedItem as Label).Tag.ToString(), (_detect_sensitivity.SelectedItem as Label).Tag.ToString(), (_detect_result.SelectedItem as Label).Tag.ToString(), PubClass.userInfo.DepartmentID, PubClass.userInfo.ID, _detect_number.Text, _object_count.Text, _object_label.Text, DateTime.Now); if (flag1) { Toolkit.MessageBox.Show("添加成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); Common.SysLogEntry.WriteLog("畜产品检测单录入", PubClass.userInfo.ShowName, OperationType.Add, "新增检测单"); clear(); ComboboxTool.InitComboboxSource(_source_company, operationContract.GetComboUserCompany(userId), "lr"); } else { Toolkit.MessageBox.Show("添加失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } }
private void _add_Click(object sender, RoutedEventArgs e) { if (_station.Text.Length == 0) { Toolkit.MessageBox.Show("检测点名称不能为空!"); return; } state = "add"; _add.IsEnabled = false; _detail_info.IsEnabled = true; Department department = _add.Tag as Department; //判断所在地下拉有无值,如果没有值,则显示文本框不显示下拉框;有值则显示下拉框不显示文本框 if (_lower_area.Items.Count == 0) { _lower_area.Visibility = Visibility.Hidden; _belong_to.Visibility = Visibility.Visible; } else { _lower_area.Visibility = Visibility.Visible; //_belong_to.Visibility = Visibility.Hidden; //_belong_to.Text = ""; } if (user_flag_tier == "0") { _Supplier_name.Visibility = Visibility.Visible; _Supplier.Visibility = Visibility.Visible; _Supplier.IsEnabled = true; ComboboxTool.InitComboboxSource(_Supplier, "select supplierId,supplierName from t_supplier", "lr"); } string regional_level = (Convert.ToInt32(_regional_level.Tag.ToString()) + 1).ToString(); _regional_level.Text = cityLevelDictionary[regional_level]; _regional_level.Tag = regional_level; _station_flag.Text = "(必填)"; //如果当前添加的是检测站,则显示检测点性质信息 if (_regional_level.Text == "检测站") { _add.Visibility = Visibility.Hidden; _station_property.Visibility = Visibility.Visible; _station_property_flag.Text = "(必填)"; } else { _area_flag.Text = "(必填)"; } if (_regional_level.Text == "检测站") { _station_name.Text = "检测站点名称:"; } else { _station_name.Text = "部门名称:"; } //新增部门,画面上字段进行初始化 _superior_department.Text = _station.Text; _station.Text = ""; _principal_name.Text = ""; _phone.Text = ""; _contact_number.Text = ""; _address.Text = ""; }
//省市上双击事件 private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount > 0) { _contact_number.Text = ""; _phone.Text = ""; _principal_name.Text = ""; _address.Text = ""; _area_flag.Text = ""; _station_flag.Text = ""; _station_property_flag.Text = ""; _detail_info_all.Visibility = Visibility.Visible; _detail_info.IsEnabled = false; text_treeView = sender as TextBlock; Department department = (sender as TextBlock).Tag as Department; _add.Tag = department; _edit.Tag = department; DataRow row = department.Row; _regional_level.Tag = row["FLAG_TIER"].ToString(); _regional_level.Text = cityLevelDictionary[row["FLAG_TIER"].ToString()]; _station_property.Visibility = Visibility.Hidden; _lower_area.Visibility = Visibility.Hidden; _edit.IsEnabled = true; _add.IsEnabled = true; if (row["FLAG_TIER"].ToString() == "4") { _station_name.Text = "检测站点名称:"; } else { _station_name.Text = "部门名称:"; } if (user_flag_tier == row["FLAG_TIER"].ToString()) { _add.Visibility = Visibility.Visible; _delete.Visibility = Visibility.Hidden; _edit.Visibility = Visibility.Hidden; } else { _add.Visibility = Visibility.Hidden; _delete.Visibility = Visibility.Visible; _edit.Visibility = Visibility.Visible; } if (_regional_level.Text == "检测站") { _add.Visibility = Visibility.Hidden; _station_property.Visibility = Visibility.Visible; } if (user_flag_tier == "0" && row["FLAG_TIER"].ToString() != "0") { _Supplier_name.Visibility = Visibility.Visible; _Supplier.Visibility = Visibility.Visible; } else { _Supplier_name.Visibility = Visibility.Hidden; _Supplier.Visibility = Visibility.Hidden; } ComboboxTool.InitComboboxSource(_Supplier, "select supplierId,supplierName from t_supplier", "lr"); DataRow[] rows = SupplierTable.Select("supplierId = '" + row["supplierId"] + "'"); if (rows.Length > 0) { _Supplier.Text = rows[0]["supplierName"].ToString(); } string city = ""; List <string> citys = null; GetCityByCode(row["FLAG_TIER"].ToString(), row["province"].ToString(), row["city"].ToString(), row["country"].ToString(), ref city, ref citys); _belong_to.Text = city; //if (citys.Count > 0) //{ _lower_area.ItemsSource = citys; //} _phone.Text = row["tel"].ToString(); _contact_number.Text = row["phone"].ToString(); _address.Text = row["address"].ToString(); _principal_name.Text = row["contacter"].ToString(); _station.Text = row["INFO_NAME"].ToString(); if (department.Parent != null) { _superior_department.Text = department.Parent.Row["INFO_NAME"].ToString(); } else { if (row["FLAG_TIER"].ToString() == "0") { _superior_department.Text = "无"; } else { _superior_department.Text = dbOperation.GetDbHelper().GetSingle(string.Format("select INFO_NAME FROM sys_client_sysdept WHERE INFO_CODE = '{0}'", row["FK_CODE_DEPT"].ToString())).ToString(); } } _direct_station.IsChecked = false; _cultivate_station.IsChecked = false; _slaughter_station.IsChecked = false; if (row["type"].ToString().Length != 0) { if (Convert.ToInt32(row["type"].ToString()) == 2) { _direct_station.IsChecked = true; } else if (Convert.ToInt32(row["type"].ToString()) == 1) { _cultivate_station.IsChecked = true; } else if (Convert.ToInt32(row["type"].ToString()) == 0) { _slaughter_station.IsChecked = true; } } //_delete.Visibility = Visibility.Hidden; //if (department.Children.Count == 0) //{ // _delete.Visibility = Visibility.Visible; //} } }
public SysReviewInfo(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; //初始化查询条件 reportDate_kssj.SelectedDate = DateTime.Now.AddDays(-1); reportDate_jssj.SelectedDate = DateTime.Now; //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, "call p_user_dept(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, "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"); ////检测结果 //DataTable table_detect_result = new DataTable(); //table_detect_result.Columns.Add("id", Type.GetType("System.String")); //table_detect_result.Columns.Add("name", Type.GetType("System.String")); //table_detect_result.Rows.Add(new object[] { "0", "未复核" }); //table_detect_result.Rows.Add(new object[] { "1", "已复核" }); //ComboboxTool.InitComboboxSource(_detect_result, table_detect_result,"cxtj"); //MyColumns.Add("zj", new MyColumn("zj", "主键") { BShow = false }); //MyColumns.Add("partid", new MyColumn("partid", "检测单位id") { BShow = false }); //MyColumns.Add("partname", new MyColumn("partname", "检测单位") { BShow = true, Width = 12 }); //MyColumns.Add("itemid", new MyColumn("itemid", "检测项目id") { BShow = false }); //MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 12 }); //MyColumns.Add("review_yes", new MyColumn("review_yes", "已复核") { BShow = true, Width = 10 }); //MyColumns.Add("review_no", new MyColumn("review_no", "未复核") { BShow = true, Width = 10 }); //MyColumns.Add("count", new MyColumn("count", "合计数量") { BShow = true, Width = 10 }); //MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); //_tableview.MyColumns = MyColumns; //_tableview.BShowDetails = true; //_tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); MyColumns.Add("orderid", new MyColumn("orderid", "检测单编号") { BShow = true, Width = 8 }); MyColumns.Add("detecttypename", new MyColumn("detecttypename", "信息来源") { BShow = true, Width = 8 }); MyColumns.Add("detectdate", new MyColumn("detectdate", "检测时间") { BShow = true, Width = 18 }); MyColumns.Add("partname", new MyColumn("partname", "检测单位") { BShow = true, Width = 16 }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 10 }); MyColumns.Add("objectname", new MyColumn("objectname", "检测对象") { BShow = true, Width = 8 }); MyColumns.Add("samplename", new MyColumn("samplename", "检测样本") { BShow = true, Width = 8 }); MyColumns.Add("sensitivityname", new MyColumn("sensitivityname", "检测灵敏度") { BShow = true, Width = 8 }); MyColumns.Add("reagentname", new MyColumn("reagentname", "检测方法") { BShow = true, Width = 10 }); MyColumns.Add("resultname", new MyColumn("resultname", "检测结果") { BShow = true, Width = 8 }); MyColumns.Add("detectusername", new MyColumn("detectusername", "检测师") { BShow = true, Width = 10 }); MyColumns.Add("areaname", new MyColumn("areaname", "来源产地") { BShow = false }); MyColumns.Add("companyname", new MyColumn("companyname", "被检单位") { BShow = true, Width = 16 }); MyColumns.Add("reviewflagname", new MyColumn("reviewflagname", "是否复核") { BShow = false }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowState = true; _tableview.StateRowEnvent += new UcTableOperableView_NoTitle.StateRowEventHandler(_tableview_StateRowEnvent); }
public SysWarningReport(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; user_flag_tier = (Application.Current.Resources["User"] as UserInfo).FlagTier; //初始化查询条件 reportDate_kssj.Value = DateTime.Now.AddDays(-1); reportDate_jssj.Value = 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(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, "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"); //复核状态 DataTable table_detect_result = new DataTable(); table_detect_result.Columns.Add("id", Type.GetType("System.String")); table_detect_result.Columns.Add("name", Type.GetType("System.String")); table_detect_result.Rows.Add(new object[] { "0", "未复核" }); table_detect_result.Rows.Add(new object[] { "1", "已复核" }); ComboboxTool.InitComboboxSource(_review_flag, table_detect_result, "cxtj"); MyColumns.Add("partid", new MyColumn("partid", "检测站点id") { BShow = false }); MyColumns.Add("partname", new MyColumn("partname", dept_name) { BShow = true, Width = 18 }); MyColumns.Add("yang", new MyColumn("yang", "阳性预警数") { BShow = true, Width = 12 }); MyColumns.Add("yang_like", new MyColumn("yang_like", "疑似阳性预警数") { BShow = true, Width = 14 }); MyColumns.Add("count", new MyColumn("count", "预警数合计") { BShow = true, Width = 12 }); MyColumns.Add("review_yes", new MyColumn("review_yes", "已复核数") { BShow = true, Width = 12 }); MyColumns.Add("review_no", new MyColumn("review_no", "未复核数") { BShow = true, Width = 12 }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowDetails = true; _tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
private void btnSave_Click(object sender, RoutedEventArgs e) { string msg = ""; if (_province.SelectedIndex < 1) { msg = "*请选择省"; } else if (_city.SelectedIndex < 1) { msg = "*请选择市"; } else if (_region.SelectedIndex < 1) { msg = "*请选择区"; } else if (_source_company.SelectedIndex == 0 || _source_company.Text == "") { msg = "*请选择来源单位"; } else if (_detect_number.Text.Trim().Length == 0) { msg = "*检疫证号不能为空"; } else if (_detect_item.SelectedIndex < 1) { msg = "*请选择检查项目"; } else if (_detect_method1.IsChecked != true && _detect_method2.IsChecked != true && _detect_method3.IsChecked != true) { msg = "*请选择检测方法"; } else if (_detect_object.SelectedIndex < 1) { msg = "*请选择检测对象"; } else if (_detect_sample.SelectedIndex < 1) { msg = "*请选择检测样本"; } else if (_detect_sensitivity.SelectedIndex < 1) { msg = "*请选择检测灵敏度"; } else if (_detect_result.SelectedIndex < 1) { msg = "*请选择检测结果"; } else if (_detect_person.Text.Trim().Length == 0) { msg = "*请输入检测师"; } else { string company_id; //判断来源单位是否存在,若不存在则插入数据库 bool exit_flag = dbOperation.Exists(string.Format("SELECT count(COMPANYID) from t_company where COMPANYNAME ='{0}' and deptid = '{1}'", _source_company.Text, (Application.Current.Resources["User"] as UserInfo).DepartmentID)); if (!exit_flag) { int n = dbOperation.ExecuteSql(string.Format("INSERT INTO t_company (COMPANYNAME,AREAID,OPENFLAG,deptid,cuserid,cdate) VALUES('{0}','{1}','{2}','{3}','{4}','{5}')", _source_company.Text, (_region.SelectedItem as Label).Tag.ToString(), '1', (Application.Current.Resources["User"] as UserInfo).DepartmentID, (Application.Current.Resources["User"] as UserInfo).ID, DateTime.Now)); if (n == 1) { company_id = dbOperation.GetSingle(string.Format("SELECT COMPANYID from t_company where COMPANYNAME ='{0}' and deptid = '{1}'", _source_company.Text, (Application.Current.Resources["User"] as UserInfo).DepartmentID)).ToString(); } else { Toolkit.MessageBox.Show("来源单位添加失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } } else { company_id = dbOperation.GetSingle(string.Format("SELECT COMPANYID from t_company where COMPANYNAME ='{0}' and deptid = '{1}'", _source_company.Text, (Application.Current.Resources["User"] as UserInfo).DepartmentID)).ToString(); } string sql = string.Format("call p_insert_detect('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')" , company_id, _detect_number.Text, (_detect_item.SelectedItem as Label).Tag.ToString(), (_detect_method1.IsChecked == true ? 1 : 0) + (_detect_method2.IsChecked == true ? 2 : 0) + (_detect_method3.IsChecked == true ? 3 : 0), (_detect_object.SelectedItem as Label).Tag.ToString(), (_detect_sample.SelectedItem as Label).Tag.ToString(), (_detect_sensitivity.SelectedItem as Label).Tag.ToString(), (_detect_result.SelectedItem as Label).Tag.ToString(), (Application.Current.Resources["User"] as UserInfo).DepartmentID, (Application.Current.Resources["User"] as UserInfo).ID, System.DateTime.Now); int i = dbOperation.ExecuteSql(sql); if (i == 1) { Toolkit.MessageBox.Show("添加成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); clear(); ComboboxTool.InitComboboxSource(_source_company, "SELECT COMPANYID,COMPANYNAME FROM v_user_company WHERE userid = " + userId, "lr"); } else { Toolkit.MessageBox.Show("添加失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } } txtMsg.Text = msg; }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (_province.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择省!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_city.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择市!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_region.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择区!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_source_company.SelectedIndex == 0 || _source_company.Text == "") { Toolkit.MessageBox.Show("请选择被检单位!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_item.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检查项目!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_method.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检测方法!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_sample_no.SelectedIndex < 1) { Toolkit.MessageBox.Show("样品编号不能为空!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_object.SelectedIndex < 1) { Toolkit.MessageBox.Show("样品名称不能为空!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_value.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请输入检测值!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_result.SelectedIndex < 1) { Toolkit.MessageBox.Show("请选择检测结果!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } if (_detect_person.Text.Trim().Length == 0) { Toolkit.MessageBox.Show("请选择检测师!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } //判断被检单位是否存在,若不存在则插入数据库 string company_id = operationContract.GetCompanyId(_source_company.Text.Trim(), PubClass.userInfo.DepartmentID); if (string.IsNullOrEmpty(company_id)) { bool flag = operationContract.AddCompany(_source_company.Text, (_region.SelectedItem as Label).Tag.ToString(), "1", PubClass.userInfo.DepartmentID, PubClass.userInfo.ID, DateTime.Now); if (!flag) { Toolkit.MessageBox.Show("被检单位添加失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } } //判断检测模式:若为农药残留检测,模式为0;否则模式为1 string detect_mode = ""; if ((_detect_item.SelectedItem as Label).Tag.ToString() == "1") { detect_mode = "0"; } else { detect_mode = "1"; } bool flag1 = detectContract.ExecuteProAddDetect(company_id, (_detect_item.SelectedItem as Label).Tag.ToString(), (_detect_method.SelectedItem as Label).Tag.ToString(), (_detect_object.SelectedItem as Label).Tag.ToString(), (_sample_no.SelectedItem as Label).Tag.ToString(), detect_mode, _detect_value.Text, (_detect_result.SelectedItem as Label).Tag.ToString(), PubClass.userInfo.DepartmentID, PubClass.userInfo.ID); if (flag1) { Toolkit.MessageBox.Show("添加成功!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); Common.SysLogEntry.WriteLog("农产品检测单录入", PubClass.userInfo.ShowName, OperationType.Add, "新增检测单"); clear(); ComboboxTool.InitComboboxSource(_source_company, operationContract.GetComboUserCompany(userId), "lr"); } else { Toolkit.MessageBox.Show("添加失败!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information); return; } }
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"); }
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_method, "select reagentId,reagentName from t_det_reagent where openFlag = '1' and reviewflag = '0'", "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"); ComboboxTool.InitComboboxSource(_detect_huanjie, "SELECT id,name FROM t_liaoning_huanjie", "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(); }
private void btnModify_Click(object sender, RoutedEventArgs e) { this.cmbPersonType.IsEnabled = true; this.txtPersonName.IsEnabled = true; this.cmbDept.IsEnabled = true; this.cmbPersonProperty.IsEnabled = true; this.txtBirthday.IsEnabled = true; this.txtHomeAddress.IsEnabled = true; this.txtPersonPhone.IsEnabled = true; this.txtComment.IsEnabled = true; this.imgPhoto.IsEnabled = true; this.cmbArea.IsEnabled = true; this.cmbBuildingNo.IsEnabled = true; this.cmbFloor.IsEnabled = true; this.cmbLocation.IsEnabled = true; this.cmbBedNo.IsEnabled = true; this.txtContactName.IsEnabled = true; this.txtContactRelationship.IsEnabled = true; this.txtContactPhone.IsEnabled = true; Flag = false; DataRow[] drs = currentTable.Select("PERSON_CODE='" + (sender as Button).Tag.ToString() + "'"); if (drs.Length == 1) { this.txtPersonCode.Text = drs[0]["PERSON_CODE"].ToString(); for (int i = 0; i < this.cmbPersonType.Items.Count; i++) { if ((this.cmbPersonType.Items[i] as Label).Tag.ToString() == drs[0]["FK_TYPE_CODE"].ToString()) { this.cmbPersonType.SelectedItem = this.cmbPersonType.Items[i]; break; } } this.txtPersonName.Text = drs[0]["PERSON_NAME"].ToString(); for (int i = 0; i < this.cmbDept.Items.Count; i++) { if ((this.cmbDept.Items[i] as Label).Tag.ToString() == drs[0]["FK_CODE_DEPT"].ToString()) { this.cmbDept.SelectedItem = this.cmbDept.Items[i]; break; } } for (int i = 0; i < this.cmbPersonProperty.Items.Count; i++) { if ((this.cmbPersonProperty.Items[i] as Label).Tag.ToString() == drs[0]["FK_POST_CODE"].ToString()) { this.cmbPersonProperty.SelectedItem = this.cmbPersonProperty.Items[i]; break; } } if (drs[0]["PERSON_SEX"].ToString() == "男") { rdbMale.IsChecked = true; } else { this.rdbFemale.IsChecked = true; } this.txtBirthday.Value = Convert.ToDateTime(drs[0]["PERSON_BIRTHDAY"]); this.txtHomeAddress.Text = drs[0]["HOME_ADDRESS"].ToString(); this.txtPersonPhone.Text = drs[0]["PERSON_PHONE"].ToString(); this.txtComment.Text = drs[0]["INFO_NOTE"].ToString(); if (drs[0]["PERSON_PHOTO"] == DBNull.Value) { this.imgPhoto.Source = null; } else { try { Byte[] imgArray = (Byte[])drs[0]["PERSON_PHOTO"]; BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.StreamSource = new MemoryStream(imgArray); bi.EndInit(); this.imgPhoto.Source = bi; } catch (Exception) { imgPhoto.Source = null; } } if (drs[0]["FK_ROOM_CODE"].ToString() != "") { for (int i = 0; i < this.cmbLocation.Items.Count; i++) { if ((cmbLocation.Items[i] as Label).Tag.ToString() == drs[0]["FK_ROOM_CODE"].ToString()) { cmbLocation.SelectedItem = cmbLocation.Items[i]; break; } } } else { cmbLocation.SelectedIndex = 0; } if (drs[0]["FK_BED_CODE"].ToString() != "") { ComboboxTool.InitComboboxSource(cmbBedNo, "SELECT INFO_CODE,INFO_NAME,FK_INFO_AREA,FK_INFO_NAME from sys_client_bed WHERE INFO_CODE not IN(select FK_BED_CODE from sys_client_person) and FK_INFO_AREA = '" + drs[0]["FK_ROOM_CODE"].ToString() + "'", "lr"); string strValue = drs[0]["FK_BED_CODE"].ToString(); //隐藏值 string strItem = drs[0]["FK_BED_CODE"].ToString(); //显示值 Label item1 = new Label(); item1.Tag = strValue; item1.Content = strItem; cmbBedNo.Items.Add(item1); for (int i = 0; i < this.cmbBedNo.Items.Count; i++) { if ((cmbBedNo.Items[i] as Label).Tag.ToString() == drs[0]["FK_BED_CODE"].ToString()) { cmbBedNo.SelectedItem = cmbBedNo.Items[i]; break; } } } else { cmbBedNo.SelectedIndex = 0; } if (cmbLocation.SelectedIndex != 0) { string parentCode = areainfoTable.Select("INFO_AREA='" + (cmbLocation.SelectedItem as Label).Tag.ToString() + "'")[0]["FK_CODE_AREA"].ToString(); for (int i = 0; i < this.cmbFloor.Items.Count; i++) { if ((cmbFloor.Items[i] as Label).Tag.ToString() == parentCode) { cmbFloor.SelectedItem = cmbFloor.Items[i]; break; } } } else { cmbFloor.SelectedIndex = 0; } if (cmbFloor.SelectedIndex != 0) { string parentCode = areainfoTable.Select("INFO_AREA='" + (cmbFloor.SelectedItem as Label).Tag.ToString() + "'")[0]["FK_CODE_AREA"].ToString(); for (int i = 0; i < this.cmbBuildingNo.Items.Count; i++) { if ((cmbBuildingNo.Items[i] as Label).Tag.ToString() == parentCode) { cmbBuildingNo.SelectedItem = cmbBuildingNo.Items[i]; break; } } } else { cmbBuildingNo.SelectedIndex = 0; } if (cmbBuildingNo.SelectedIndex != 0) { string parentCode = areainfoTable.Select("INFO_AREA='" + (cmbBuildingNo.SelectedItem as Label).Tag.ToString() + "'")[0]["FK_CODE_AREA"].ToString(); for (int i = 0; i < this.cmbArea.Items.Count; i++) { if ((cmbArea.Items[i] as Label).Tag.ToString() == parentCode) { cmbArea.SelectedItem = cmbArea.Items[i]; break; } } } else { cmbArea.SelectedIndex = 0; } this.txtContactName.Text = drs[0]["PERSON_ICE"].ToString(); this.txtContactRelationship.Text = drs[0]["ICE_RELATIONS"].ToString(); this.txtContactPhone.Text = drs[0]["ICE_PHONE"].ToString(); this.container.IsEnabled = false; this.btnSave.Tag = (sender as Button).Tag.ToString(); Flag = true; } }
public SysReviewInfo(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_item, "call p_user_item(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测结果 DataTable table_detect_result = new DataTable(); table_detect_result.Columns.Add("id", Type.GetType("System.String")); table_detect_result.Columns.Add("name", Type.GetType("System.String")); table_detect_result.Rows.Add(new object[] { "0", "未复核" }); table_detect_result.Rows.Add(new object[] { "1", "已复核" }); ComboboxTool.InitComboboxSource(_detect_result, table_detect_result, "cxtj"); MyColumns.Add("zj", new MyColumn("zj", "主键") { BShow = false }); MyColumns.Add("partid", new MyColumn("partid", "检测站点id") { BShow = false }); MyColumns.Add("partname", new MyColumn("partname", "检测站点") { BShow = true, Width = 12 }); MyColumns.Add("itemid", new MyColumn("itemid", "检测项目id") { BShow = false }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 12 }); MyColumns.Add("review_yes", new MyColumn("review_yes", "已复核") { BShow = true, Width = 10 }); MyColumns.Add("review_no", new MyColumn("review_no", "未复核") { BShow = true, Width = 10 }); MyColumns.Add("count", new MyColumn("count", "合计数量") { BShow = true, Width = 10 }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowDetails = true; _tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
public SysWarningInfo(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_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'"); MyColumns.Add("zj", new MyColumn("zj", "主键") { BShow = false }); MyColumns.Add("districtid", new MyColumn("districtid", "区id") { BShow = false }); MyColumns.Add("districtname", new MyColumn("districtname", "区县") { BShow = true, Width = 10 }); MyColumns.Add("partid", new MyColumn("partid", "检测站点id") { BShow = false }); MyColumns.Add("partname", new MyColumn("partname", "检测站点") { BShow = true, Width = 12 }); MyColumns.Add("itemid", new MyColumn("itemid", "检测项目id") { BShow = false }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 12 }); MyColumns.Add("objectid", new MyColumn("objectid", "检测对象id") { BShow = false }); MyColumns.Add("objectname", new MyColumn("objectname", "检测对象") { BShow = true, Width = 10 }); MyColumns.Add("yang_like", new MyColumn("yang_like", "疑似阳性") { BShow = true, Width = 10 }); MyColumns.Add("yang", new MyColumn("yang", "阳性") { BShow = true, Width = 10 }); MyColumns.Add("count", new MyColumn("count", "合计数量") { BShow = true, Width = 10 }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowDetails = true; _tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
public SysWarningInfo(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; user_flag_tier = (Application.Current.Resources["User"] as UserInfo).FlagTier; //初始化查询条件 reportDate_kssj.Value = DateTime.Now.AddDays(-1); reportDate_jssj.Value = 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(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, "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_object, "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_result, "SELECT resultId,resultName FROM t_det_result where openFlag='1'"); MyColumns.Add("zj", new MyColumn("zj", "主键") { BShow = false }); //MyColumns.Add("districtid", new MyColumn("districtid", "区id") { BShow = false }); //MyColumns.Add("districtname", new MyColumn("districtname", "区县") { BShow = true,Width = 10 }); MyColumns.Add("partid", new MyColumn("partid", "检测站点id") { BShow = false }); MyColumns.Add("partname", new MyColumn("partname", dept_name) { BShow = true, Width = 18 }); MyColumns.Add("itemid", new MyColumn("itemid", "检测项目id") { BShow = false }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 14 }); MyColumns.Add("objectid", new MyColumn("objectid", "检测对象id") { BShow = false }); MyColumns.Add("objectname", new MyColumn("objectname", "检测对象") { BShow = true, Width = 12 }); MyColumns.Add("yang_like", new MyColumn("yang_like", "疑似阳性") { BShow = true, Width = 12 }); MyColumns.Add("yang", new MyColumn("yang", "阳性") { BShow = true, Width = 12 }); MyColumns.Add("count", new MyColumn("count", "合计数量") { BShow = true, Width = 12 }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowDetails = true; _tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
public SysReviewInfoProduce() { InitializeComponent(); //初始化查询条件 reportDate_kssj.SelectedDate = DateTime.Now.AddDays(-1); reportDate_jssj.SelectedDate = DateTime.Now; //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, operationContract.ExecuteProUserDept(PubClass.userInfo.ID), "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, operationContract.GetComboDetItemProduce(), "cxtj"); MyColumns.Add("orderid", new MyColumn("orderid", "检测单编号") { BShow = true, Width = 8 }); MyColumns.Add("detecttypename", new MyColumn("detecttypename", "信息来源") { BShow = true, Width = 8 }); MyColumns.Add("detectdate", new MyColumn("detectdate", "检测时间") { BShow = true, Width = 18 }); MyColumns.Add("partname", new MyColumn("partname", "检测单位") { BShow = true, Width = 16 }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 10 }); MyColumns.Add("objectname", new MyColumn("objectname", "样品名称") { BShow = true, Width = 8 }); MyColumns.Add("reagentname", new MyColumn("reagentname", "检测方法") { BShow = true, Width = 10 }); MyColumns.Add("detectvalue", new MyColumn("detectvalue", "检测值") { BShow = true, Width = 8 }); MyColumns.Add("resultname", new MyColumn("resultname", "检测结果") { BShow = true, Width = 8 }); MyColumns.Add("detectusername", new MyColumn("detectusername", "检测师") { BShow = true, Width = 10 }); MyColumns.Add("areaname", new MyColumn("areaname", "来源产地") { BShow = false }); MyColumns.Add("companyname", new MyColumn("companyname", "被检单位") { BShow = true, Width = 16 }); MyColumns.Add("reviewflagname", new MyColumn("reviewflagname", "是否复核") { BShow = false }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowState = true; _tableview.StateRowEnvent += new UcTableOperableView_NoTitle.StateRowEventHandler(_tableview_StateRowEnvent); }
public SysReviewLog(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; 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; } //初始化查询条件 reportDate_kssj.SelectedDate = DateTime.Now.AddDays(-1); reportDate_jssj.SelectedDate = DateTime.Now; //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, "call p_dept_cxtj(" + (Application.Current.Resources["User"] as UserInfo).ID + ")", "cxtj"); //检测项目 ComboboxTool.InitComboboxSource(_detect_item, "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"); MyColumns.Add("orderid", new MyColumn("orderid", "检测单编号") { BShow = true, Width = 10 }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 14 }); MyColumns.Add("reviewdate", new MyColumn("reviewdate", "复核检测时间") { BShow = true, Width = 18 }); MyColumns.Add("reviewreagentname", new MyColumn("reviewreagentname", "复核检测方法") { BShow = true, Width = 14 }); MyColumns.Add("reviewresultname", new MyColumn("reviewresultname", "复核检测结果") { BShow = true, Width = 14 }); MyColumns.Add("reviewusername", new MyColumn("reviewusername", "复核检测师") { BShow = true, Width = 14 }); MyColumns.Add("reviewreason", new MyColumn("reviewreason", "复核原因说明") { BShow = true, Width = 22 }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowDetails = true; _tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
public AddReviewDetails(IDBOperation dbOperation, int id, SysReviewInfo sysreviewinfo) { InitializeComponent(); this.dbOperation = dbOperation; this.sysreviewinfo = sysreviewinfo; dbHelper = DbHelperMySQL.CreateDbHelper(); orderid = id; string reviewflag = dbHelper.GetSingle(string.Format("select ReviewFlag from t_detect_report where ORDERID = '{0}'", id)).ToString(); DataTable table = dbOperation.GetDbHelper().GetDataSet(string.Format("call p_detect_details_new('{0}')", id)).Tables[0]; //给画面上的控件赋值 //图片地址改为从数据库中获取 string picture_url = dbOperation.GetDbHelper().GetSingle("select pictureurl from t_url ").ToString(); if (picture_url == "") { picture_url = "http://www.zrodo.com:8080/xmjc/"; } _img.Source = new BitmapImage(new Uri(picture_url + table.Rows[0][20].ToString())); //_img.Source = new BitmapImage(new Uri("http://www.zrodo.com:8080/xmjc/" + table.Rows[0][20].ToString())); _orderid.Text = table.Rows[0][18].ToString(); _areaName.Text = table.Rows[0][10].ToString(); _companyName.Text = table.Rows[0][11].ToString(); _cardId.Text = table.Rows[0][12].ToString(); _objectLable.Text = table.Rows[0][21].ToString(); _objectCount.Text = table.Rows[0][22].ToString(); _itemName.Text = table.Rows[0][3].ToString(); _objectName.Text = table.Rows[0][4].ToString(); _sampleName.Text = table.Rows[0][5].ToString(); _reangetName.Text = table.Rows[0][7].ToString(); _sensitivityName.Text = table.Rows[0][6].ToString(); _resultName.Text = table.Rows[0][8].ToString(); _deptName.Text = table.Rows[0][2].ToString(); _detectDate.Text = table.Rows[0][1].ToString(); _detectUserName.Text = table.Rows[0][9].ToString(); _detectTypeName.Text = table.Rows[0][0].ToString(); _cardbrand.Text = table.Rows[0][23].ToString(); _cardno.Text = table.Rows[0][24].ToString(); //检测结果为疑似阳性变红 if (_resultName.Text == "疑似阳性" || _resultName.Text == "确证阳性") { _resultName.Foreground = Brushes.Red; } else { _resultName.Foreground = Brushes.Black; } if (reviewflag == "1") { _reviewUserid.Text = table.Rows[0][14].ToString(); _reviewReagent_text.Text = table.Rows[0][15].ToString(); _reviewResult_text.Text = table.Rows[0][16].ToString(); _reviewDate.Text = table.Rows[0][17].ToString(); _reviewBz.Text = table.Rows[0][19].ToString(); btnSave.Visibility = Visibility.Hidden; _reviewReagent.Visibility = Visibility.Hidden; _reviewResult.Visibility = Visibility.Hidden; _reviewReagent_text.Visibility = Visibility.Visible; _reviewResult_text.Visibility = Visibility.Visible; _reviewBz.IsEnabled = false; } else { _reviewUserid.Text = (Application.Current.Resources["User"] as UserInfo).ShowName; _reviewDate.Text = DateTime.Now.ToString(); ComboboxTool.InitComboboxSource(_reviewResult, "SELECT resultId,resultName FROM t_det_result where openFlag = '1' ORDER BY id", "lr"); ComboboxTool.InitComboboxSource(_reviewReagent, "select reagentId,reagentName from t_det_reagent where openFlag = '1' and reagentId <> '1'", "lr"); btnSave.Visibility = Visibility.Visible; _reviewReagent.Visibility = Visibility.Visible; _reviewResult.Visibility = Visibility.Visible; _reviewReagent_text.Visibility = Visibility.Hidden; _reviewResult_text.Visibility = Visibility.Hidden; _reviewBz.IsEnabled = true; } }
public NewDetectProduce(string sample_no, string object_id) { InitializeComponent(); this.sampleNo = sample_no; this.objectId = object_id; ProvinceCityTable = PubClass.ProvinceCityTable; DataTable table = operationContract.GetDeptProvinceCity(deptid); 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 = operationContract.GetProvince(deptid); int i = 1; foreach (DataRow row in rows) { if (row["cityId"].ToString() == proviceid) { _province.SelectedIndex = i; } i = i + 1; } ComboboxTool.InitComboboxSource(_source_company, operationContract.GetComboUserCompany(userId), "lr"); ComboboxTool.InitComboboxSource(_detect_item, operationContract.GetComboDetItemProduce(), "lr"); _detect_item.SelectionChanged += new SelectionChangedEventHandler(_detect_item_SelectionChanged); ComboboxTool.InitComboboxSource(_detect_method, operationContract.GetComboDetReagentProduce(), "lr"); ComboboxTool.InitComboboxSource(_sample_no, operationContract.GetComboSampleNo("p", userId), "lr"); ComboboxTool.InitComboboxSource(_detect_object, operationContract.GetComboDetObjectProduce(), "lr"); ComboboxTool.InitComboboxSource(_detect_result, operationContract.GetComboDetResult(), "lr"); _entering_datetime.Text = string.Format("{0:g}", System.DateTime.Now); _source_company.SelectionChanged += new SelectionChangedEventHandler(_source_company_SelectionChanged); _detect_person.Text = PubClass.userInfo.ShowName; _detect_site.Text = sysSetContract.GetDeptName(PubClass.userInfo.DepartmentID); //赋值样品编号和样品名称 for (int j = 0; j < _sample_no.Items.Count; j++) { if ((_sample_no.Items[j] as Label).Tag.ToString() == sampleNo) { _sample_no.SelectedItem = _sample_no.Items[j]; break; } } for (int j = 0; j < _detect_object.Items.Count; j++) { if ((_detect_object.Items[j] as Label).Tag.ToString() == objectId) { _detect_object.SelectedItem = _detect_object.Items[j]; break; } } }
}; //初始化变量 public SysCertificateMonthReport(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; _year.ItemsSource = year; _year.SelectedIndex = 5; _month.ItemsSource = month; _month.SelectedIndex = 8; //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); }
}; //初始化变量 public SysMonthReport(IDBOperation dbOperation) { InitializeComponent(); this.dbOperation = dbOperation; user_flag_tier = (Application.Current.Resources["User"] as 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; } } ////检测单位 //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(_detect_item, "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_result, "SELECT resultId,resultName FROM t_det_result where openFlag='1' ORDER BY id", "cxtj"); //如果登录用户的部门是站点级别,则将查询条件检测单位赋上默认值 if (isDept()) { _detect_dept.SelectedIndex = 1; } _tableview.DetailsRowEnvent += new UcTableOperableView_NoPages.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }
public SysReviewLog(string depttype) { InitializeComponent(); this.dept_type = depttype; user_flag_tier = PubClass.userInfo.FlagTier; //初始化查询条件 reportDate_kssj.SelectedDate = DateTime.Now.AddDays(-1); reportDate_jssj.SelectedDate = DateTime.Now; //检测单位 ComboboxTool.InitComboboxSource(_detect_dept, operationContract.ExecuteProCxtj(PubClass.userInfo.ID), "cxtj"); //检测项目 switch (dept_type) { case "0": ComboboxTool.InitComboboxSource(_detect_item, operationContract.GetComboDetItemProduce(), "cxtj"); break; case "1": ComboboxTool.InitComboboxSource(_detect_item, operationContract.GetComboDetItemFishery(), "cxtj"); break; case "2": ComboboxTool.InitComboboxSource(_detect_item, operationContract.GetComboDetItemAnimal(), "cxtj"); break; default: break; } MyColumns.Add("orderid", new MyColumn("orderid", "检测单编号") { BShow = true, Width = 10 }); MyColumns.Add("itemname", new MyColumn("itemname", "检测项目") { BShow = true, Width = 14 }); MyColumns.Add("reviewdate", new MyColumn("reviewdate", "复核检测时间") { BShow = true, Width = 18 }); MyColumns.Add("reviewreagentname", new MyColumn("reviewreagentname", "复核检测方法") { BShow = true, Width = 14 }); MyColumns.Add("reviewresultname", new MyColumn("reviewresultname", "复核检测结果") { BShow = true, Width = 14 }); MyColumns.Add("reviewusername", new MyColumn("reviewusername", "复核检测师") { BShow = true, Width = 14 }); MyColumns.Add("reviewreason", new MyColumn("reviewreason", "复核原因说明") { BShow = true, Width = 22 }); MyColumns.Add("sum_num", new MyColumn("sum_num", "总行数") { BShow = false }); _tableview.MyColumns = MyColumns; _tableview.BShowDetails = true; _tableview.DetailsRowEnvent += new UcTableOperableView_NoTitle.DetailsRowEventHandler(_tableview_DetailsRowEnvent); }