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 SysNewDetectAnimal() { InitializeComponent(); ProvinceCityTable = PubClass.ProvinceCityTable; DataTable table = operationContract.GetDeptProvinceCity(deptid); DataRow[] rows; if (table.Rows.Count == 0) { rows = ProvinceCityTable.Select("pid = '0001'"); } else { rows = table.Select(); } //获取样品编号 SampleNoTable = operationContract.GetComboSampleNo("a", userId); //画面初始化-新增检测单画面 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(_sample_no, SampleNoTable, "lr"); _sample_no.SelectionChanged += new SelectionChangedEventHandler(_sample_no_SelectionChanged); ComboboxTool.InitComboboxSource(_detect_sample, operationContract.GetComboDetSample("a"), "lr"); ComboboxTool.InitComboboxSource(_detect_object, operationContract.GetComboDetObjectAnimal(), "lr"); ComboboxTool.InitComboboxSource(_detect_item, operationContract.GetComboDetItemAnimal(), "lr"); _detect_item.SelectionChanged += new SelectionChangedEventHandler(_detect_item_SelectionChanged); ComboboxTool.InitComboboxSource(_detect_method, operationContract.GetComboDetReagentAnimal(), "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); }