Пример #1
0
        public async Task <MemberUpgradeViewModel> GetUpgrade(int id, string clubReference = "BRIO")
        {
            var model = new MemberUpgradeViewModel();

            try
            {
                model = await _context.GetUpgradeInfoAsync(id, clubReference);
            }
            catch (Exception ex)
            {
                if (model == null)
                {
                    model = new MemberUpgradeViewModel();
                }

                model.Message = $"Error: {ex.Message}";
            }

            return(model);
        }
Пример #2
0
        public async Task <MemberUpgradeViewModel> AddUpdateUpgrade(int id, [FromBody] JObject value)
        {
            var model = new MemberUpgradeViewModel();

            try
            {
                model       = value.ToObject <MemberUpgradeViewModel>();
                model.RSIId = id;

                model = await _context.AddUpdateUpgradeInfoAsync(model);
            }
            catch (Exception ex)
            {
                if (model == null)
                {
                    model = new MemberUpgradeViewModel();
                }

                model.Message = $"Error: {ex.Message}";
            }

            return(model);
        }