コード例 #1
0
        public async Task <ActionResult> ConsumptionLog(string returnUrl)
        {
            ViewBag.Message = "Consumption Log History";
            List <ConsumptionLogViewModel> customerList = new List <ConsumptionLogViewModel>();

            List <ConsumptionLog> consumptionLogs = await client.ConsumptionLogGetById(Utility.Utility.DecryptAndGetCustomPrincipal(Request.Cookies[FormsAuthentication.FormsCookieName]).CustomerID);

            foreach (ConsumptionLog cons in consumptionLogs)
            {
                ConsumptionLogViewModel temp = new ConsumptionLogViewModel();
                temp.Id                 = cons.Id;
                temp.CustomerId         = cons.CustomerId;
                temp.SmartEnergyMeterId = cons.SmartEnergyMeterId;
                temp.Unit               = cons.Unit;
                temp.CreatedDateTime    = cons.CreatedDateTime;

                customerList.Add(temp);
            }
            return(View(customerList));
        }