예제 #1
0
        public async void DeletePromotion()
        {
            CompanyViewModel.SelectedBranch.Promotions.RemoveAt(Promotions.FindIndex(p => p.Id.Equals(MySelectedPromotion.Id)));
            await _promotionService.Delete(MySelectedPromotion);

            RaisePropertyChanged(nameof(Promotions));
            _navigationService.NavigateTo(nameof(BranchPromotionsPage));
        }
예제 #2
0
        public async void EditPromotion(string title, string description, DateTime startdate, DateTime enddate, bool usesCoupon)
        {
            MySelectedPromotion.Title       = title;
            MySelectedPromotion.Description = description;
            MySelectedPromotion.StartDate   = startdate;
            MySelectedPromotion.EndDate     = enddate;
            MySelectedPromotion.UsesCoupon  = usesCoupon;

            CompanyViewModel.SelectedBranch.Promotions[Promotions.FindIndex(p => p.Id.Equals(MySelectedPromotion.Id))] = MySelectedPromotion;

            await _promotionService.Update(MySelectedPromotion);

            RaisePropertyChanged(nameof(Promotions));
            _navigationService.NavigateTo(nameof(BranchPromotionsPage));
        }