public void SetDataContext(int rtuOrGroupId, string rtuOGroupName, string showId, List <int> lsttimetable, ObservableCollection <TimeTableInfomationItem> items, bool has3005, bool has3006, int areaid)
        {
            var frmSelectTimeTableViewModel = new FrmSelectTimeTableViewModel(items, lsttimetable, has3005);

            frmSelectTimeTableViewModel.ShowRtuOrGroupId     = showId;
            frmSelectTimeTableViewModel.SelectRtuOrGroupId   = rtuOrGroupId;
            frmSelectTimeTableViewModel.SelectRtuOrGroupName = rtuOGroupName;
            if (rtuOrGroupId < 1000000)
            {
                frmSelectTimeTableViewModel.Msg = "分组";
            }
            else
            {
                frmSelectTimeTableViewModel.Msg = "终端";
            }
            AreaId = areaid;

            DataContext = frmSelectTimeTableViewModel;

            if (has3006 || (has3005 == false && has3006 == false))
            {
                K7.IsEnabled = true;
                K8.IsEnabled = true;
            }
            else
            {
                K7.IsEnabled = false;
                K8.IsEnabled = false;
            }
        }
Beispiel #2
0
        public void SetDataContext(int rtuOrGroupId, string rtuOGroupName, int kLoops, int oldSelectTimeTableId, string showId, ObservableCollection <TimeTableInfomationItem> items, bool has3005, bool has3006, int areaid)
        {
            var frmSelectTimeTableViewModel = new FrmSelectTimeTableViewModel(items, has3005);


            frmSelectTimeTableViewModel.ShowRtuOrGroupId     = showId;
            frmSelectTimeTableViewModel.SelectRtuOrGroupId   = rtuOrGroupId;
            frmSelectTimeTableViewModel.SelectRtuOrGroupName = rtuOGroupName;
            frmSelectTimeTableViewModel.OldSelectTimeTableId = oldSelectTimeTableId;
            frmSelectTimeTableViewModel.SelectKloop          = kLoops;
            DataContext = frmSelectTimeTableViewModel;
            AreaId      = areaid;
        }
        //public void SetDataContextRtuParaSwitchInViewModel(RtuParaAnalogueAmpViewModel rtuParaAnalogueAmpViewModel )
        //{
        //    DataContext = rtuParaAnalogueAmpViewModel;
        //}

        public void SetDataContext(bool isGroup, int rtuOrGroupId, string rtuOGroupName, int kLoops, int oldSelectTimeTableId,
                                   int phyId)
        {
            ViewModel.FrmSelectTimeTableViewModel frmSelectTimeTableViewModel = new FrmSelectTimeTableViewModel();
            frmSelectTimeTableViewModel.IsAllChildApplyThisTimeTableVisi = Visibility.Collapsed;
            frmSelectTimeTableViewModel.IsGroup = isGroup;
            frmSelectTimeTableViewModel.SelectRtuOrGroupPhyId = phyId;
            frmSelectTimeTableViewModel.SelectRtuOrGroupId    = rtuOrGroupId;
            frmSelectTimeTableViewModel.SelectRtuOrGroupName  = rtuOGroupName;
            frmSelectTimeTableViewModel.OldSelectTimeTableId  = oldSelectTimeTableId;
            frmSelectTimeTableViewModel.SelectKloop           = kLoops;
            frmSelectTimeTableViewModel.ApplyRtusType         = 1;

            frmSelectTimeTableViewModel.OnBtnOkClick += new EventHandler(frmSelectTimeTableViewModel_OnBtnOkClick);
            //if (isGroup)
            //{
            //    if (!Sr.EquipmentGroupInfoHolding.Services.ServicesGrpSingleInfoHold.GrpInfoDictionary.ContainsKey(rtuOrGroupId))
            //    {
            //        frmSelectTimeTableViewModel.OldSelectTimeTableName = "无法查阅分组名称";
            //    }

            //    else
            //        frmSelectTimeTableViewModel.OldSelectTimeTableName =
            //            Sr.EquipmentGroupInfoHolding.Services.ServicesGrpSingleInfoHold.GrpInfoDictionary[rtuOrGroupId].GroupName;
            //}
            //else
            //{
            //    if (
            //        !Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold.EquipmentInfoDictionary .
            //             ContainsKey(rtuOrGroupId))
            //    {
            //        frmSelectTimeTableViewModel.OldSelectTimeTableName = "无法查阅终端名称";
            //    }
            //    else
            //    {
            //        var f =
            //            Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold.EquipmentInfoDictionary [
            //                rtuOrGroupId];
            //         frmSelectTimeTableViewModel.OldSelectTimeTableName = f.RtuName;

            //    }


            //}
            DataContext = frmSelectTimeTableViewModel;
        }
Beispiel #4
0
 public EventArgsFrmSelectTimeTable(FrmSelectTimeTableViewModel tmp)
 {
     Info = tmp;
 }