Пример #1
0
        public void TestGetEnergyItemStatisticViewModelByUserName()
        {
            EnergyItemStatisticService   service   = new EnergyItemStatisticService();
            EnergyItemStatisticViewModel ViewModel = service.GetViewModelByUserName("admin");

            Console.WriteLine(UtilTest.GetJson(ViewModel));
        }
Пример #2
0
        public object Get()
        {
            string userName = User.Identity.Name;

            try
            {
                return(service.GetViewModelByUserName(userName));
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }