コード例 #1
0
        public AddEditControlSystemTypeModel()
        {
            mControlSystemType = new ControlSystemType();

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanModifyConfig);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        }
        public AddEditExistingControlTypeTestingPropertyDialog(ControlSystemType controlSystemType, int? groupId)
        {
            InitializeComponent();

            var model = new AddEditExistingControlSystemTypeTestingPropertyViewModel(controlSystemType, groupId);
            model.Loaded +=
                () =>
                {
                    model.View = this;
                    DataContext = model;
                    Utils.ResetOriginalValues(this);
                };
        }
        public AddEditExistingControlSystemTypeTestingPropertyViewModel(ControlSystemType controlSystemType, int? groupId)
        {
            //ADDING
            mGroupId = groupId;
            mControlSystemTypeId = controlSystemType.Id;
            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanModify);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);

            PropertyComboEnabled = true;
            GroupComboEnabled = true;

            LoadAddingData(controlSystemType.Id);
        }
コード例 #4
0
ファイル: TestMigrater.cs プロジェクト: barrett2474/CMS2
 private static bool MatchControlSystemTypeFailed(CmsEntities cee, ControlModule cm, out ControlSystemType controlSystemType)
 {
     controlSystemType = (from x in cee.ControlSystemTypes where x.Name.Equals(cm.ControlModuleTypical.Name, StringComparison.CurrentCultureIgnoreCase) select x).FirstOrDefault();
     if (controlSystemType == null)
     {
         Logger.Out(string.Format("Warning: Control {0} - No matchng ControlSystemType found in CMS using '{1}'.", cm.Tag, cm.ControlModuleTypical.Name));
         return true;
     }
     return false;
 }
コード例 #5
0
ファイル: TestMigrater.cs プロジェクト: barrett2474/CMS2
 private static bool MatchControlSystemFailed(CmsEntities cee, ControlModule cm, ControlSystemType controlSystemType, out ControlSystem controlSystem)
 {
     controlSystem = (from x in cee.ControlSystems where x.Name.Equals(cm.Tag, StringComparison.CurrentCultureIgnoreCase) && x.ControlSystemTypeId == controlSystemType.Id select x).FirstOrDefault();
     if (controlSystem == null)
     {
         Logger.Out(string.Format("Warning: Control {0} - No matchng ControlSystem found in CMS using '{0}'.", cm.Tag));
         return true;
     }
     return false;
 }
コード例 #6
0
 private void cmsWebServiceClient_GetControlSystemTypeCompleted(object sender, GetControlSystemTypeCompletedEventArgs e)
 {
     mControlSystemType = e.Result;
     OnDataSourceLoaded();
 }
コード例 #7
0
        public ControlSystemType SaveControlSystemType(ControlSystemType controlSystemType)
        {
            using (var cee = new CmsEntities())
            {
                var original = (from x in cee.ControlSystemTypes where x.Id == controlSystemType.Id select x).FirstOrDefault();

                if (original == null)
                {
                    controlSystemType.Code = controlSystemType.Name.Replace(" ", "");
                    controlSystemType.IsActive = true;
                    cee.ControlSystemTypes.Add(controlSystemType);
                }
                else
                {
                    original.Name = controlSystemType.Name;
                    original.Description = controlSystemType.Description;
                    original.Code = controlSystemType.Name.Replace(" ", "");
                    original.IsActive = true;
                }

                cee.SaveChanges();
            }
            return controlSystemType;
        }