Exemplo n.º 1
0
        public async Task <ActionResult> GetInitState(int y, int m)
        {
            try
            {
                var id = User.FindFirstValue(ClaimTypes.NameIdentifier);
                List <OffRecordModel> model =
                    await _recordManager.GetMonthOffRecordsAsync(id, y, m);

                UserInfoModel user = await _userInfoManager.GetUserInfoAsync(id);

                return(Json(new
                {
                    payload = new
                    {
                        events = model,
                        a = user.AnnualLeaves,
                        s = user.SickLeaves,
                        f = user.FamilyCareLeaves
                    }
                }));
            }
            catch (Exception)
            {
                return(StatusCode(404));
            }
        }