示例#1
0
        public async Task CheckBoxChanged(ChangeEventArgs e, BenefitModel benefit)
        {
            var newValue = (bool)e.Value;

            benefit.Selected   = newValue;
            SaveButtonDisabled = false;

            if (newValue)
            {
                benefit.StartDate = DateTime.Now;
                benefit.EndDate   = DateTime.Now.AddYears(1);
            }
            await OnPremiumToggle.InvokeAsync(Benefits.Any(b => b.Premium && b.Selected));
        }
示例#2
0
        public async Task <List <BenefitModel> > GetBenefits()
        {
            var benefits = new List <BenefitModel>();

            var command = this.RawDbConnection.CreateCommand();

            command.CommandText = "select Title, Description from CareerBenefit where rowstatus = 1 ";
            using (var read = await command.ExecuteReaderAsync())
            {
                while (await read.ReadAsync())
                {
                    var benefit = new BenefitModel
                    {
                        Title       = read[0].ToString(),
                        Description = read[1].ToString()
                    };
                    benefits.Add(benefit);
                }
            }
            return(benefits);
        }