Exemple #1
0
 public NuevoRol(Model.RolModel _rol)
 {
     InitializeComponent();
     controller = new Controller.RolController();
     rol = _rol;
     cbEstados.Enabled = false;
 }
Exemple #2
0
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                foreach ( var family in checkInState.CheckIn.GetFamilies( true ) )
                {
                    foreach ( var person in family.People )
                    {
                        foreach ( var kioskGroupType in checkInState.Kiosk.ActiveGroupTypes( checkInState.ConfiguredGroupTypes ) )
                        {
                            if ( kioskGroupType.KioskGroups.SelectMany( g => g.KioskLocations ).Any( l => l.IsCheckInActive && l.IsActiveAndNotFull ) )
                            {
                                if ( !person.GroupTypes.Any( g => g.GroupType.Id == kioskGroupType.GroupType.Id ) )
                                {
                                    var checkinGroupType = new CheckInGroupType();
                                    checkinGroupType.GroupType = kioskGroupType.GroupType;
                                    person.GroupTypes.Add( checkinGroupType );
                                }
                            }
                        }
                    }
                }

                return true;
            }

            return false;
        }
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                var family = checkInState.CheckIn.Families.Where( f => f.Selected ).FirstOrDefault();
                if ( family != null )
                {
                    foreach ( var person in family.People.Where( p => p.Selected ) )
                    {
                        foreach ( var groupType in person.GroupTypes.Where( g => g.Selected ) )
                        {
                            foreach ( var group in groupType.Groups )
                            {
                                foreach ( var location in group.Locations.ToList() )
                                {
                                    if ( !location.Location.IsActive )
                                    {
                                        group.Locations.Remove( location );
                                    }
                                }
                            }
                        }
                    }
                }

                return true;
            }

            return false;
        }
Exemple #4
0
        /// <summary>
        /// Gets the HTML preview.
        /// </summary>
        /// <param name="communication">The communication.</param>
        /// <param name="person">The person.</param>
        /// <returns></returns>
        public override string GetHtmlPreview( Model.Communication communication, Person person )
        {
            var rockContext = new RockContext();

            // Requery the Communication object
            communication = new CommunicationService( rockContext ).Get( communication.Id );

            var globalAttributes = Rock.Web.Cache.GlobalAttributesCache.Read();
            var mergeValues = Rock.Web.Cache.GlobalAttributesCache.GetMergeFields( null );

            if ( person != null )
            {
                mergeValues.Add( "Person", person );

                var recipient = communication.Recipients.Where( r => r.PersonId == person.Id ).FirstOrDefault();
                if ( recipient != null )
                {
                    // Add any additional merge fields created through a report
                    foreach ( var mergeField in recipient.AdditionalMergeValues )
                    {
                        if ( !mergeValues.ContainsKey( mergeField.Key ) )
                        {
                            mergeValues.Add( mergeField.Key, mergeField.Value );
                        }
                    }
                }
            }

            string message = communication.GetChannelDataValue( "Message" );
            return message.ResolveMergeFields( mergeValues );
        }
        public void CopyTo(ModelField field, Model model)
        {
            field.Apply(this);

            if (this.IDProperty)
            {
                model.IDProperty = field.Name;
            }

            if (this.CustomSortHandler != null)
            {
                field.CustomSortType.Fn = this.CustomSortHandler;
            }

            if (this.SerializeHandler != null)
            {
                field.Serialize.Fn = this.SerializeHandler;
            }

            if (this.ConvertHandler != null)
            {
                field.Convert.Fn = this.ConvertHandler;
            }

            if (this.DefaultValue != null)
            {
                field.DefaultValue = TokenUtils.RawWrap(JSON.Serialize(this.DefaultValue));
            }
        }
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                foreach ( var family in checkInState.CheckIn.Families.ToList() )
                {
                    foreach ( var person in family.People.ToList() )
                    {
                        foreach ( var groupType in person.GroupTypes.ToList() )
                        {
                            foreach ( var group in groupType.Groups.ToList() )
                            {
                                foreach ( var location in group.Locations.ToList() )
                                {
                                    if ( location.Schedules.Count == 0 )
                                    {
                                        group.Locations.Remove( location );
                                    }
                                }
                            }
                        }
                    }
                }

                return true;

            }

            return false;
        }
        public PresentationModel(Model model)
        {
            InitializePoseKeyDictionary();
            _model = model;
            List<Tuple<string, string>> imageList = new List<Tuple<string, string>>
            {
                new Tuple<string, string>("fingersSpread", "Image/fingersSpread.png"),
                new Tuple<string, string>("waveOut", "Image/waveOut.png"),
                new Tuple<string, string>("waveIn", "Image/waveIn.png"),
                new Tuple<string, string>("fist", "Image/fist.png"),
                new Tuple<string, string>("keyboard", "Image/keyboard.png"),
            };

            foreach (Tuple<string, string> item in imageList)
            {
                AddImage(item.Item1, Image.FromFile(item.Item2));
            }

            Bitmap source = new Bitmap("Image/arm-device.png");
            List<Tuple<string, Rectangle>> sectionList = new List<Tuple<string, Rectangle>>
            {
                new Tuple<string, Rectangle>("rollDown", new Rectangle(0, 0, 230, 230)),
                new Tuple<string, Rectangle>("rollUp", new Rectangle(182, 0, 230, 230)),
                new Tuple<string, Rectangle>("pitchDown", new Rectangle(0, 182, 230, 230)),
                new Tuple<string, Rectangle>("pitchUp", new Rectangle(180, 180, 230, 230)),
                new Tuple<string, Rectangle>("yawUp", new Rectangle(0, 360, 230, 230)),
                new Tuple<string, Rectangle>("yawDown", new Rectangle(182, 360, 230, 230)),
            };

            foreach (Tuple<string, Rectangle> item in sectionList)
            {
                CutImage(item.Item1, source, item.Item2);
            }
        }
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState == null )
            {
                return false;
            }
            var family = checkInState.CheckIn.CurrentFamily;
            if ( family != null )
            {
                var remove = GetAttributeValue( action, "Remove" ).AsBoolean();

                if ( checkInState.CheckInType.TypeOfCheckin == TypeOfCheckin.Family )
                {
                    var currentPerson = checkInState.CheckIn.CurrentPerson;
                    if ( currentPerson != null )
                    {
                        FilterGroups( currentPerson, rockContext, remove );
                    }
                }
                else
                {
                    foreach ( var person in family.People )
                    {
                        FilterGroups( person, rockContext, remove );
                    }
                }
            }

            return true;
        }
 public GuardSpawner(Model m, XmlElement e)
     : base(m, e)
 {
     NumGuards = e.GetAttributeInt("numguards", 2);
     MaxGuards = e.GetAttributeInt("maxguards", 2);
     RespawnRate = e.GetAttributeFloat("respawnrate", 0);
 }
Exemple #10
0
        public FilterGraphViewModel(Model.FilterGraph graph)
        {
            _filterGraph = graph;

            var filterViewModels = graph.Filters.ToDictionary(i => i, i => new ViewModel.FilterViewModel(i, this));
            var connections = new List<ConnectionViewModel>();

            foreach (var f in filterViewModels)
            {
                foreach (var outputPin in f.Key.OutputPins)
                {
                    var outputPinViewModel = f.Value.FindOutput(outputPin.PinDesc.Name);

                    foreach (var inputPin in outputPin.ConnectedPins)
                    {
                        var otherFilter = inputPin.FilterInstance;

                        var inputPinViewModel = filterViewModels[otherFilter].FindInput(inputPin.PinDesc.Name);

                        connections.Add(new ConnectionViewModel(outputPinViewModel, inputPinViewModel));
                    }
                }
            }

            FilterLookup = filterViewModels.ToDictionary(kvp => kvp.Key.Guid, kvp => kvp.Value);
            Connections = connections;

            graph.RunStateChanged += graph_RunStateChanged;
        }
		public void Init(Model model) {
			OnCompleted += () => {
				try {
					disposables.Dispose();
				} catch (Exception err) {
					dbg.Error(err);
				}
			};

			VerifyAccess();
			disposables.Add(renderSubscription);
			isPaused = false;
			InitializeComponent();

			captionNoSignal.CreateBinding(TextBlock.TextProperty, Strings, s => s.noSignal);
			noSignalPanel.Visibility = System.Windows.Visibility.Hidden;

			btnPause.Click += new RoutedEventHandler(btnPause_Click);
			btnResume.Click += new RoutedEventHandler(btnPause_Click);

			btnPause.CreateBinding(Button.VisibilityProperty, this, x => { return x.isPaused ? Visibility.Collapsed : Visibility.Visible; });
			btnResume.CreateBinding(Button.VisibilityProperty, this, x => { return !x.isPaused ? Visibility.Collapsed : Visibility.Visible; });

			playbackStatistics.Visibility = AppDefaults.visualSettings.ShowVideoPlaybackStatistics ? Visibility.Visible : Visibility.Collapsed;

			if (model.isUriEnabled) {
				uriString.Visibility = System.Windows.Visibility.Visible;
				uriString.Text = model.mediaUri.uri;
			} else {
				uriString.Visibility = System.Windows.Visibility.Collapsed;
			}
			VideoStartup(model);
		}
Exemple #12
0
 private void AddControl(Model.LEDScreen data)
 {
     var control = new LEDScreenControl();
     control.BindData(data);
     control.Margin = new System.Windows.Forms.Padding(10);
     flowLayoutPanel1.Controls.Add(control);
 }
        public VoicePausingViewModel(Model.Profile profile)
        {
            this.Profile = profile;

            this.AddPausePhraseCommand = new ActionCommand(this.AddPausePhrase,
                () => this.PausePhraseName != null &&
                      this.PausePhraseName.Trim().Length > 0 &&
                      !this.Profile.PauseRecognitionPhrases.Any(phr => phr == this.PausePhraseName.Trim()));
            this.RemovePausePhraseCommand = new ActionCommand(this.RemovePausePhrase,
                () => this.CurrentPausePhrase != null);
            this.RenamePausePhraseCommand = new ActionCommand(this.RenamePausePhrase,
                () => this.CurrentPausePhrase != null &&
                      this.PausePhraseName != null &&
                      this.PausePhraseName.Trim().Length > 0 &&
                      !this.Profile.PauseRecognitionPhrases.Any(phr => phr == this.PausePhraseName.Trim()));

            this.AddUnpausePhraseCommand = new ActionCommand(this.AddUnpausePhrase,
                () => this.UnpausePhraseName != null &&
                      this.UnpausePhraseName.Trim().Length > 0 &&
                      !this.Profile.UnpauseRecognitionPhrases.Any(phr => phr == this.UnpausePhraseName.Trim()));
            this.RemoveUnpausePhraseCommand = new ActionCommand(this.RemoveUnpausePhrase,
                () => this.CurrentUnpausePhrase != null);
            this.RenameUnpausePhraseCommand = new ActionCommand(this.RenameUnpausePhrase,
                () => this.CurrentUnpausePhrase != null &&
                      this.UnpausePhraseName != null &&
                      this.UnpausePhraseName.Trim().Length > 0 &&
                      !this.Profile.UnpauseRecognitionPhrases.Any(phr => phr == this.UnpausePhraseName.Trim()));
        }
Exemple #14
0
        protected PinViewModel(FilterViewModel parent, Model.Pin pin)
        {
            Parent = parent;
            _pin = pin;

            parent.PropertyChanged += parent_PropertyChanged;
        }
Exemple #15
0
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                var family = checkInState.CheckIn.Families.Where( f => f.Selected ).FirstOrDefault();
                if ( family != null )
                {
                    var service = new GroupMemberService( rockContext );
                    foreach ( var groupMember in service.GetByGroupId( family.Group.Id ).AsNoTracking().ToList() )
                    {
                        if ( !family.People.Any( p => p.Person.Id == groupMember.PersonId ) )
                        {
                            var person = new CheckInPerson();
                            person.Person = groupMember.Person.Clone( false );
                            person.FamilyMember = true;
                            family.People.Add( person );
                        }
                    }

                    return true;
                }
                else
                {
                    errorMessages.Add( "There is not a family that is selected" );
                }

                return false;
            }

            return false;
        }
Exemple #16
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="obj">Map object to display</param>
        public OtherObject(Model.MapObject obj)
        {
            InitializeComponent();

            this.InitialiseEventHandlers();

            this.MapObject = obj;

            this.pictureBox.Image = obj.Image;
            this.labelObjectName.Text = obj.Name + " [" + obj.ID.ToString() + "]";

            if (obj.Faction != null)
            {
                this.labelFactionName.Text = obj.Faction.Name;
            }
            else
            {
                this.labelFactionName.Text = "Unclaimed";
            }

            if (obj.GetType() == typeof(Planet))
            {
                Planet p = (Planet)obj;
                this.labelMassOrEnergy.Text = p.Energy.ToString();
            }
            else
            {
                Ship s = (Ship)obj;
                this.labelMassOrEnergy.Text = s.Mass.ToString();
            }
        }
 public LicenseDetailsViewItem(Model.License license, Model.Customer purchasingCustomer, Model.Customer owningCustomer, Model.SKU sku)
     : base(license)
 {
     OwningCustomerName = (owningCustomer != null) ? owningCustomer.Name : "Not owned";
     PurchasingCustomerName = purchasingCustomer.Name;
     SKUName = sku.SkuCode;
 }
Exemple #18
0
        public MainMenuViewModel(Model.User currentUser, string controllerName)
            : base()
        {
            CurrentUser = new CurrentUserViewModel(currentUser);

            this.Controller = controllerName;
        }
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                foreach ( var family in checkInState.CheckIn.Families.Where( f => f.Selected ).ToList() )
                {
                    foreach ( var person in family.People )
                    {
                        foreach ( var kioskGroupType in checkInState.Kiosk.FilteredGroupTypes( checkInState.ConfiguredGroupTypes ) )
                        {
                            if ( kioskGroupType.KioskGroups.SelectMany( g => g.KioskLocations ).Any( l => l.Location.IsActive ) )
                            {
                                if ( !person.GroupTypes.Any( g => g.GroupType.Id == kioskGroupType.GroupType.Id ) )
                                {
                                    var checkinGroupType = new CheckInGroupType();
                                    checkinGroupType.GroupType = kioskGroupType.GroupType.Clone( false );
                                    checkinGroupType.GroupType.CopyAttributesFrom( kioskGroupType.GroupType );
                                    person.GroupTypes.Add( checkinGroupType );
                                }
                            }
                        }
                    }
                }

                return true;
            }

            return false;
        }
Exemple #20
0
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                var family = checkInState.CheckIn.Families.Where( f => f.Selected ).FirstOrDefault();
                if ( family != null )
                {
                    foreach ( var person in family.People.Where( p => p.Selected ) )
                    {
                        string personsGender = person.Person.Gender.ToString( "d" );

                        foreach ( var groupType in person.GroupTypes.ToList() )
                        {
                            foreach ( var group in groupType.Groups.ToList() )
                            {
                                var groupAttributes = group.Group.GetAttributeValues( "Gender" );
                                if ( groupAttributes.Any() && !groupAttributes.Contains( personsGender ) )
                                {
                                    groupType.Groups.Remove( group );
                                }
                            }
                        }
                        
                    }
                }

                return true;
            }

            return false;
        }
		public ActiveRecordGraphView(Model model) : this()
		{
			_model = model;

			_model.OnProjectReplaced += new ProjectReplaceDelegate(_model_OnProjectReplaced);
			_model.OnProjectChanged += new ProjectDelegate(OnProjectChange);
		}
Exemple #22
0
 public void AddRow(Model.Program model)
 {
     var rowIndex = dataGridView1.Rows.Add();
     var row = dataGridView1.Rows[rowIndex];
     row.Cells["ID"].Value = model.ID;
     row.Cells["Content"].Value = model.Content;
 }
Exemple #23
0
        /// <summary>
        /// Executes the specified workflow.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The workflow action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public override bool Execute( RockContext rockContext, Model.WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            var checkInState = GetCheckInState( entity, out errorMessages );
            if ( checkInState != null )
            {
                foreach ( var family in checkInState.CheckIn.Families.ToList() )
                {
                    foreach ( var person in family.People.ToList() )
                    {
                        if ( person.GroupTypes.Count == 0 )
                        {
                            family.People.Remove( person );
                        }
                        else if ( person.GroupTypes.All( t => t.ExcludedByFilter ) )
                        {
                            person.ExcludedByFilter = true;
                        }
                    }
                }

                return true;
            }

            return false;
        }
        public View_Desktop_ExtratoClientes(Model.Vo.Cliente.Model_Vo_Cliente pClient)
        {
            InitializeComponent();
            txtNome.Text = Convert.ToString(pClient.Nome);
            //MessageBox.Show(Convert.ToString(pClient.Nome)); teste

        }
        public void verify_fields_values_extraction_from_given_instance()
        {
            var model = new Model
            {
                Value1 = 1,
                Value2 = 2,
                Internal = new Model
                {
                    Value1 = 11,
                    Value2 = null
                }
            };

            Assert.Equal(1, ExpressiveAnnotations.Helper.ExtractValue(model, "Value1"));
            Assert.Equal(11, ExpressiveAnnotations.Helper.ExtractValue(model, "Internal.Value1"));
            Assert.Equal(null, ExpressiveAnnotations.Helper.ExtractValue(model, "Internal.Value2"));

            var e = Assert.Throws<ArgumentException>(() => ExpressiveAnnotations.Helper.ExtractValue(model, "internal"));
            Assert.Equal("Value extraction interrupted. Field internal not found.\r\nParameter name: internal", e.Message);

            e = Assert.Throws<ArgumentException>(() => ExpressiveAnnotations.Helper.ExtractValue(model, "Internal.Value123"));
            Assert.Equal("Value extraction interrupted. Field Value123 not found.\r\nParameter name: Internal.Value123", e.Message);

            model.Internal = null;
            e = Assert.Throws<ArgumentException>(() => ExpressiveAnnotations.Helper.ExtractValue(model, "Internal.Value1"));
            Assert.Equal("Value extraction interrupted. Field Internal is null.\r\nParameter name: Internal.Value1", e.Message);
        }
Exemple #26
0
 /// <summary>
 /// Construct viewmodel
 /// </summary>
 /// <param name="user">User that this viewmodel represents</param>
 public UserViewModel(Model.User user)
     : this()
 {
     this.UserId = user.UserId;
     this.Email = user.Email;
     this.HasLocalAccount = OAuthWebSecurity.HasLocalAccount(user.UserId);
 }
		public static FSharpAsync<Result> Show(IUnityContainer container, Model model) {
			return container.StartViewActivity<Result>(context => {
				var view = new EngineControlsView(model, context);
				var presenter = container.Resolve<IViewPresenter>();
				presenter.ShowView(view);
			});
		}
 /// <summary>
 /// Construct viewmodel
 /// </summary>
 /// <param name="transaction">Transaction that this viewmodel represents</param>
 public TransactionViewModel(Model.Transaction transaction)
     : this()
 {
     this.TransactionId = transaction.TransactionId;
     this.Status = transaction.Status;
     this.CreatedDateTime = transaction.CreatedDateTime;
 }
 public VuelosEncontrados(Model.CompraModel _compraModel)
 {
     InitializeComponent();
     viajeDao = new Dao.ViajeDao();
     this.compraModel = _compraModel;
     btnSeleccionar.Enabled = false;
 }
        public UserObjectRightIndexViewItem(Model.UserObjectRight right)
            : base(right)
        {
            RightName = right.Right.DisplayName;

            ObjectName = GetEntityName(right);
        }