Exemplo n.º 1
0
        public void TestGetIsAlarmingBy_userName()
        {
            MeterAlarmService service = new MeterAlarmService();
            var viewModel             = service.GetIsAlarming("Admin");

            Console.WriteLine(UtilTest.GetJson(viewModel));
        }
Exemplo n.º 2
0
        public object GetMeterAlarming(string type = "A")
        {
            try
            {
                string userName = User.Identity.Name;
                switch (type.ToUpper())
                {
                case "A":
                    return(service.GetIsAlarming(userName));

                case "B":
                    return(service.GetAlarmingViewModel(userName));
                }

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