コード例 #1
0
        public static ArrayList GetMetaData(IServiceData servdata, int iso, int hoid, int reId)
        {
            if (servdata == null)
            {
                throw new ArgumentException("IServiceData");
            }

            var list    = ArrayList.Synchronized(new ArrayList());
            var isodata = servdata.RetrieveTableData("iso_country", "ISO", string.Format("where iso_number={0}", iso));

            list.Add(new Tuple <string, string>("Country", isodata[0].Cast <string>()));

            //var rdata = servdata.RetrieveTableData("br_ho_id, br_name, br_trading_name, br_add_1, br_add_3, br_add_5, br_add_6", "Branch", string.Format("where br_iso_id={0} and br_id={1}", iso, reId));
            //if (rdata != null && rdata.Length == 7)
            //{
            //    var odata = servdata.RetrieveTableData("ho_name, ho_trading_name, ho_email_1", "HeadOffice", string.Format("where ho_iso_id={0} and ho_id={1}", iso, rdata[0].Cast<string>()));
            //    if (odata != null && odata.Length == 3)
            //    {

            //        //list.Add(new Tuple<string, string>("Head office name", odata[0].Cast<string>()));
            //        //list.Add(new Tuple<string, string>("Head office Id", rdata[0].Cast<int>().ToString()));
            //        //list.Add(new Tuple<string, string>("Email address", odata[2].Cast<string>()));

            //        //list.Add(new Tuple<string, string>("Retailer name", rdata[1].Cast<string>()));
            //        //list.Add(new Tuple<string, string>("Retailer Id", reId.ToString()));
            //        //list.Add(new Tuple<string, string>("Retailer trading name", rdata[2].Cast<string>()));
            //        //list.Add(new Tuple<string, string>("", ""));
            //        //list.Add(new Tuple<string, string>("Retailer address", rdata[3].Cast<string>()));
            //        //list.Add(new Tuple<string, string>("Town", rdata[5].Cast<string>()));
            //        //list.Add(new Tuple<string, string>("Country", rdata[6].Cast<string>()));
            //    }
            //}

            return(list);
        }
コード例 #2
0
        public IServiceData Update(IServiceData data)
        {
            if (string.IsNullOrEmpty(data.Version))
            {
                data = data
                       .ReplaceProperty(data.Properties[DirectoryWatchShared.BufferSizePropertyName], new Property(DirectoryWatchShared.BufferSizePropertyName, typeof(int), ValueUseOption.RuntimeRead, 8192)
                {
                    Value = data.Properties[DirectoryWatchShared.BufferSizePropertyName].Value
                })
                       .ReplaceProperty(data.Properties[DirectoryWatchShared.FilterPropertyName], new Property(DirectoryWatchShared.FilterPropertyName, typeof(string), ValueUseOption.RuntimeRead, string.Empty)
                {
                    Value = data.Properties[DirectoryWatchShared.FilterPropertyName].Value
                })
                       .ReplaceProperty(data.Properties[DirectoryWatchShared.IncludeSubdirectoriesPropertyName], new Property(DirectoryWatchShared.IncludeSubdirectoriesPropertyName, typeof(bool), ValueUseOption.RuntimeRead, false)
                {
                    Value = data.Properties[DirectoryWatchShared.IncludeSubdirectoriesPropertyName].Value
                })
                       .UpdateVersion("1");
            }

            if (data.Version == CurrentVersion)
            {
                return(data);
            }

            throw new Exception(string.Format("Unknown version [{0}] specified.", data.Version));
        }
コード例 #3
0
 public ServiceManager(IServiceData serviceData, IStringLocalizer <IServiceManager> localizer, ILogger <IServiceManager> logger,
                       IKeyManager keyManager, IRoleManager roleManager, IApiManager apiManager
                       )
 {
     _serviceData = serviceData;
     _localizer   = localizer;
     _logger      = logger;
     _keyManager  = keyManager;
     _roleManager = roleManager;
     _apiManager  = apiManager;
 }
コード例 #4
0
 public DataController(IServiceData serviceData)
 {
     _serviceData = serviceData;
 }
コード例 #5
0
 protected ServiceContext()
 {
     _serviceData = new ServiceData();
 }
コード例 #6
0
 public DirectoryWatchDesigner(IServiceData data, IDesignerContext context)
     : base(data, context)
 {
     SetPropertyAttributes();
 }
コード例 #7
0
 public ServiceBuilder AddData(IServiceData data)
 {
     return(Update(x => x.Data = data));
 }
コード例 #8
0
 public override IServiceData UpdateToLatestVersion(IServiceData data)
 {
     return(ServiceUpdater.Instance.Update(data));
 }
コード例 #9
0
 public override ServiceDesigner CreateDesigner(IServiceData data, IDesignerContext context)
 {
     return(new DirectoryWatchDesigner(data, context));
 }
コード例 #10
0
        public static ArrayList GetMetaData(IServiceData servdata, int iso, int hoid, int reId)
        {
            var list = ArrayList.Synchronized(new ArrayList());

            return(list);
        }
コード例 #11
0
 public ExpenseService(IServiceData ed)
 {
     _ed = ed;
 }