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);
        }
Exemple #4
0
 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;
 }
Exemple #5
0
 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;
 }
 private void cmsWebServiceClient_GetControlSystemTypeCompleted(object sender, GetControlSystemTypeCompletedEventArgs e)
 {
     mControlSystemType = e.Result;
     OnDataSourceLoaded();
 }
        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;
        }