public ServicePanel GetService(string serverID) { ServicePanel service = new ServicePanel(); service.ManagedServiceList = serverbll.GetServices(serverID); service.WindowsServiceList = wsbll.GetAllServices(serverID); return(service); }
/// <summary> /// 序列化面板内容 /// </summary> /// <param name="sp"></param> /// <returns></returns> public static string ToJson(ServicePanel sp) { string json = ""; JavaScriptSerializer jss = new JavaScriptSerializer(); json = jss.Serialize(sp); return(json); }
private void LoadServicesToStackPanel() { SpVehicleServices.Children.Clear(); List <Service> services = servicesSqlRepository.ReadAll(); foreach (Service service in services) { ServicePanel servicePanel = new ServicePanel(service); SpVehicleServices.Children.Add(servicePanel); } }
/// <summary> /// 返回数据实体 /// </summary> /// <param name="con"></param> /// <returns></returns> public static ServicePanel GetModel(string con) { JavaScriptSerializer jss = new JavaScriptSerializer(); ServicePanel model; try { model = jss.Deserialize <ServicePanel>(con); if (model == null) { model = new ServicePanel(); } } catch (Exception) { model = new ServicePanel(); } return(model); }
private async Task LoadServicesToStackPanel() { SpServices.Children.Clear(); List <Service> services = await serviceApi.GetServices(); if (services.Count > 0) { LblNoServices.Visibility = Visibility.Hidden; foreach (Service service in services) { ServicePanel servicePanel = new ServicePanel(service, hairSalon); SpServices.Children.Add(servicePanel); } } else { LblNoServices.Visibility = Visibility.Visible; } }