Пример #1
0
 public ShoppeViewModel(ShopPromotion shopPromotion, Page page) : base(page)
 {
     manager            = DataManager.DefaultManager;
     ShopName           = shopPromotion.ShopName;
     ShopDetails        = shopPromotion.ShopDetails;
     ShopBannerImageUrl = shopPromotion.ShopBannerImageUrl;
 }
        private IActionResult AllInOne(int monthDay, int day, CurrentWorkPlace data, ShopPromotion shopBonus, int attendence, WorkerPromotion bonus, Vacation holiday, decimal salaryForDay, decimal SalaryForRealDate)
        {
            var absentDaysSalary         = attendence * salaryForDay;
            var shpBonus                 = shopBonus.Reward;
            var awardForWorker           = bonus.Reward;
            var tetilihesabla            = (holiday.VacationEnded - holiday.VacationStarted);
            var tetilBonus               = tetilihesabla.Days / 2;
            var tetilTotal               = (tetilBonus * salaryForDay);
            var TotalSalary              = SalaryForRealDate - absentDaysSalary + shpBonus + tetilTotal + awardForWorker;
            PayrollViewModel payrollView = new PayrollViewModel()
            {
                WorkerId          = data.WorkerId,
                Worker            = data.Worker,
                PositionId        = data.PositionId,
                Position          = data.Position,
                VacationBonus     = tetilTotal,
                CountofAbsentDays = attendence,
                WorkerPromotionId = bonus.Id,
                Bonus             = bonus.Reward,
                ShopBonus         = shpBonus,
                ShopPromotionId   = shopBonus.Id,
                TotalSalary       = TotalSalary
            };

            if (day == monthDay)
            {
                ConfigurePayrollViewModel(payrollView);
            }
            return(View(payrollView));
        }
        public async Task <IActionResult> ShopPromotion(ShopPromotionViewModel model)
        {
            if (ModelState.IsValid)
            {
                ShopPromotion promotion = new ShopPromotion()
                {
                    Id         = model.Id,
                    ShopId     = model.ShopId,
                    Reward     = model.Reward,
                    MaxAmount  = model.MaxAmount,
                    MinAmount  = model.MinAmount,
                    StartDate  = model.StartDate,
                    FinishDate = model.FinishDate
                };
                await _dbContext.ShopPromotions.AddAsync(promotion);

                await _dbContext.SaveChangesAsync();

                return(RedirectToAction(nameof(ShopPromotionList)));
            }
            return(View());
        }
Пример #4
0
 public ShoppePromotionViewModel(Page page) : base(page)
 {
     manager           = DataManager.DefaultManager;
     ShopPromotionList = new ObservableRangeCollection <ShopPromotion>();
     SelectedShop      = new ShopPromotion();
 }
        private IActionResult ShopBonusOnly(int monthDay, int day, CurrentWorkPlace data, ShopPromotion shopBonus, int attendence, decimal salaryForDay, decimal SalaryForRealDate)
        {
            var shpBonus                 = shopBonus.Reward;
            var absentDaysSalary         = attendence * salaryForDay;
            var TotalSalary              = SalaryForRealDate - absentDaysSalary + shpBonus;
            PayrollViewModel payrollView = new PayrollViewModel()
            {
                WorkerId          = data.WorkerId,
                Worker            = data.Worker,
                PositionId        = data.PositionId,
                Position          = data.Position,
                ShopBonus         = shpBonus,
                ShopPromotionId   = shopBonus.Id,
                CountofAbsentDays = attendence,
                TotalSalary       = TotalSalary
            };

            if (day == monthDay)
            {
                ConfigurePayrollViewModel(payrollView);
            }
            return(View(payrollView));
        }
Пример #6
0
 public ShoppePage(ShopPromotion shopPromotion)
 {
     InitializeComponent();
     BindingContext = viewModel = new ShoppeViewModel(shopPromotion, this);
 }