private void Init() { _Window.cbStation.SelectionChanged += new SelectionChangedEventHandler(cbStation_SelectionChanged); _Window.cbDeviceTypeID.SelectionChanged += new SelectionChangedEventHandler(cbStation_SelectionChanged); _Window.cbDeviceID.SelectionChanged += new SelectionChangedEventHandler(cbDeviceID_SelectionChanged); //初使化值 DateTimeHH = GlobalData.DateHH; DateTimeMi = GlobalData.DateMi; SelectDateTimeHH = "00"; SelectDateTimeMi = "00"; StationDA _staDA = new StationDA(); StationORList = _staDA.selectAllStation(); DeviceAndTypeDA _DTypeDA = new DeviceAndTypeDA(); this.DeviceTypeORList = _DTypeDA.GetAllDeviceType(); if (OperationType == OpType.Alert) { LoadVlaue(); if (StationORList != null && InspectionObj != null) { var vS = from f in StationORList where f.Stationid == InspectionObj.Stationid select f; if (vS.Count() != 0) SelectStationOR = vS.First(); } if (DeviceTypeORList != null && InspectionObj != null) { var vDty = from f in DeviceTypeORList where f.Devicetypeid == InspectionObj.Devicetypeid select f; if (vDty.Count() != 0) SelectDeviceTypeOR = vDty.First(); } } }
private void Init() { cbStation.SelectionChanged += new SelectionChangedEventHandler(cbStation_SelectionChanged); cbDeviceTypeID.SelectionChanged += new SelectionChangedEventHandler(cbStation_SelectionChanged); cbDeviceID.SelectionChanged += new SelectionChangedEventHandler(cbDeviceID_SelectionChanged); StationDA _staDA = new StationDA(); StationORList = _staDA.selectAllStation(); DeviceAndTypeDA _DTypeDA = new DeviceAndTypeDA(); this.DeviceTypeORList = _DTypeDA.GetAllDeviceType(); ReportType = new ObservableCollection<string>() { "按月统计", "按日统计" }; SelectReport = "按月统计"; }