public IActionResult OnGet(int?Billings_Id)
        {
            //Subscriber_ID = 5;

            if (Billings_Id.HasValue)
            {
                billingInfo = _BillingData.GetBilling_Id(Billings_Id.Value);
            }

            if (billingInfo == null)
            {
                return(RedirectToPage("/NotFound"));
            }
            return(Page());
        }
示例#2
0
        public BillingsRealData UpdateSelectedBillings(BillingsRealData UpdateDevice)
        {
            SqlParameter parameter1 = new SqlParameter("@DeviceId", UpdateDevice.DEviceId);
            SqlParameter parameter2 = new SqlParameter("@startDate", UpdateDevice.startDate);
            SqlParameter parameter3 = new SqlParameter("@endDate", UpdateDevice.endDate);

            //SqlParameter parameter4 = new SqlParameter("@Billings_Id", UpdateDevice.Billings_Id);

            _context.Database.ExecuteSqlRaw("dbo.Insert_SelectEnergyConsumed @DeviceId, @startDate, @endDate,@Billings_Id", parameter1, parameter2, parameter3);

            //var deviceInfo = _context.deviceInfos.Attach(UpdateDevice);
            //UpdateDevice.Transaction_Date = DateTime.UtcNow;
            //deviceInfo.State = EntityState.Modified;
            //_context.SaveChanges();
            return(UpdateDevice);
        }
示例#3
0
        public IActionResult OnGet(int?Subscriber_ID)
        {
            billingloginS = _BillingData.GetSubscriber_IDlogin(User.Identity.Name);
            if (billingloginS == null)
            {
                return(RedirectToPage("/account/login", new { area = "identity" }));
            }

            Subscriber_ID = billingloginS.Subscriber_ID;

            if (Subscriber_ID.HasValue)
            {
                billingInfo = _BillingData.GetBillingBySubscriberIdCurrentMonth(Subscriber_ID.Value);
            }

            if (billingInfo == null)
            {
                TempData["biilinginfo"] = "true";
                // return RedirectToPage("/Error");
            }
            return(Page());
        }