using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using YBDevice.Application;

namespace YBDevice.NWeb.Pages.RegUser
{
    public class FamilyModel : BaseModel
    {
        public string defaulttime = $"{DateTime.Now.Date} ~ {DateTime.Now.Date.AddDays(1).AddSeconds(-1)}";
        public string maxtime = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
        public string mintime = DateTime.Now.AddDays(-1).AddMonths(-1).ToString("yyyyy-MM-dd");
        public string time = $"{DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")} ~ {DateTime.Now.ToString("yyyy-MM-dd")}";
        public int familyid = 0;
        public MeasureUserDto data;
        private readonly IResultService _resultService;
        public FamilyModel(IResultService resultService)
        {
            _resultService = resultService;
        }
        public async Task OnGetAsync(int id)
        {
            familyid = id;
           data = await  _resultService.GetUserData(id);
        }
    }
}
