Esempio n. 1
0
        public IActionResult onGet()
        {
            //string id = "*****@*****.**";
            var user = User.FindFirst(ClaimTypes.NameIdentifier).Value;

            billingloginS = _BillingData.GetSubscriber_IDlogin(user);

            int?Subscriber_ID = billingloginS.Subscriber_ID;

            if (Subscriber_ID != null)
            {
                return(Ok(_BillingData.GetBillingBySubscriberIdCurrentMonth((int)Subscriber_ID)));
            }
            else
            {
                return(Ok());
            }
        }
        public IActionResult onGet()
        {
            var user = User.Identity.Name;

            ///string id = "*****@*****.**";       User.Identity.Name
            //var user = httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
            billingloginS = _BillingData.GetSubscriber_IDlogin(user);

            int?Subscriber_ID = billingloginS.Subscriber_ID;

            if (Subscriber_ID != null)
            {
                var model = _BillingData.GetAllBillings_First3Month((int)Subscriber_ID)
                            .Select(s => new { s.EnergyConsumedFor30Days, s.BillingMonth }).ToList();

                return(Ok(model));
            }
            else
            {
                return(Ok());
            }
        }