public void TestGetIsAlarmingBy_userName() { MeterAlarmService service = new MeterAlarmService(); var viewModel = service.GetIsAlarming("Admin"); Console.WriteLine(UtilTest.GetJson(viewModel)); }
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); } }