Ejemplo n.º 1
0
        public ServicePanel GetService(string serverID)
        {
            ServicePanel service = new ServicePanel();

            service.ManagedServiceList = serverbll.GetServices(serverID);
            service.WindowsServiceList = wsbll.GetAllServices(serverID);
            return(service);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
        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;
            }
        }