示例#1
0
        public StatusCode Init(string param_key)
        {
            StatusCode retVal = StatusCode.SUCCEED_STATUS;

            lock (this)
            {
                if (CanInitialize == false)
                {
                    return(retVal);
                }

                string strValue = Access.ParameterAccess.GetStringValue(param_key);
                StatusCode.Debug("KEY:" + param_key + " VAL:" + strValue, Config);
                List <short> lstServerToActivate = new List <short>();
                if (string.IsNullOrEmpty(strValue) == false)
                {
                    lstServerToActivate = Newtonsoft.Json.JsonConvert.DeserializeObject <List <short> >(strValue);
                }

                List <Models.ServiceType> lstType          = GyomuDataAccess.GetAllServiceType();
                List <Models.Service>     lstServerService = GyomuDataAccess.GetAllService();

                retVal = internalInit(lstServerService, lstType);
                if (retVal.IsSucceeded == false)
                {
                    return(retVal);
                }
            }
            return(retVal);
        }
示例#2
0
        public StatusCode Init(short[] serviceIds)
        {
            StatusCode retVal = StatusCode.SUCCEED_STATUS;

            lock (this)
            {
                if (CanInitialize == false)
                {
                    return(retVal);
                }

                //Data.CommonData commonData = new Data.CommonData();
                //commonData.LoadServer(serviceIds);
                List <Models.ServiceType> lstType    = GyomuDataAccess.GetAllServiceType();
                List <Models.Service>     lstService = GyomuDataAccess.GetAllService().Where(s => serviceIds.Contains(s.id)).ToList();

                retVal = internalInit(lstService, lstType);
                if (retVal.IsSucceeded == false)
                {
                    return(retVal);
                }
            }
            return(retVal);
        }