private void ExecuteAddNew(object parameter)
 {
     Reasons.Add(new ModelBaseVM()
     {
         Name = string.Empty, IsEnabled = true, IsChecked = false
     });
     ScrollToIndex = Reasons.Count() - 1;
     CheckValidation();
 }
        protected override async System.Threading.Tasks.Task onInit()
        {
            if (Reasons.Count < 1)
            {
                var lookups = await DataService.GetLookups(3);

                lookups.AttendanceReasons.ForEach(ar => Reasons.Add(ar));
                lookups.Users.ForEach(u => Users.Add(u));
            }
        }
Exemple #3
0
        public void Init()
        {
            if (Student != null)
            {
                switch (BookingType)
                {
                case BookingType.green:
                {
                    _myBookingList = BookingLists.FirstOrDefault();
                    break;
                }

                case BookingType.yellow:
                {
                    var list = BookingLists.FirstOrDefault(x =>
                                                           x.Curricula.Any(c => c.Id == Student.Curriculum.Id));
                    if (list != null)
                    {
                        _myBookingList = list;
                    }
                    else
                    {
                        _myBookingList = BookingLists.FirstOrDefault(x => !x.Curricula.Any());
                    }

                    break;
                }

                case BookingType.red:
                {
                    _myBookingList = BookingLists.FirstOrDefault(x =>
                                                                 x.Curricula.Any(c => c.Id == Student.Curriculum.Id));
                    break;
                }
                }
            }

            if (!Occurrence.IsAvailable)
            {
                IsAvailable = false;
                Reasons.Add("Eintragung ist von Admin-Seite aus gesperrt worden.");
            }

            if (BookingType == BookingType.red && _myBookingList == null)
            {
                IsAvailable = false;
                Reasons.Add("Diese Lehrveranstaltung steht für meinen Studiengang nicht zur Verfügung.");
            }

            if (_myBookingList != null && _myBookingList.Capacity >= 0)
            {
                IsUnrestricted = false;
                AvailableSeats = _myBookingList.Capacity - _myBookingList.Participients.Count;
            }
        }
Exemple #4
0
        public void AddReason(decimal score, string reason, StockTrend trend = StockTrend.Bullish, bool isSignificant = false)
        {
            if (trend == StockTrend.Bearish && score > 0)
            {
                score = score * -1;
            }

            Reasons.Add(new ReasonScore {
                Reason = reason, Score = score, Trend = trend, IsSignificant = isSignificant
            });
        }
Exemple #5
0
        private void GetReasons()
        {
            Reasons.Clear();

            Reasons.Add("The Computer Won't Start");
            Reasons.Add("The Screen is Blank");
            Reasons.Add("Abnormally Functioning");
            Reasons.Add("OS Won't Boot");
            Reasons.Add("The Screen is Frozen");
            Reasons.Add("Computer is Slow.");
            Reasons.Add("Strange Noises");
            Reasons.Add("Slow Internet");
        }
        public async void OnFetchReasons(object sender, int e)
        {
            Reasons.Clear();
            var reasons = await _commentsDataAccess.GetAllCommentsByTypeId(e);

            var mappedReasons = _mapper.Map <List <Model.CommentsSelectionModel> >(reasons);

            foreach (var item in mappedReasons)
            {
                Reasons.Add(item);
            }

            IsLoading = false;
        }
        public override async void Refresh()
        {
            base.Refresh();

            Refreshing = true;

            var reasons = await Services.Host.ReasonService.GetReasons();

            Reasons.Clear();

            var    enumerable    = reasons as Reason[] ?? reasons.ToArray();
            Reason defaultReason = null;

            if (enumerable.Any())
            {
                foreach (var reason in enumerable)
                {
                    if (reason.Default == true)
                    {
                        defaultReason = reason;
                    }

                    Reasons.Add(new ReasonViewModel(reason));
                }
            }

            if (defaultReason != null)
            {
                SelectedReason = new ReasonViewModel(defaultReason);
            }
            else
            {
                SelectedReason = new ReasonViewModel(new Reason()
                {
                    Text = ""
                });
            }

            //else
            //{
            //    NoReasons?.Invoke(this, EventArgs.Empty);
            //}

            Refreshing = false;
        }