protected virtual void LoadConfig(WebParameter p, GoData d) { foreach (var item in MyConfig.GetConfigurationList("ConnectionStrings")) { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } p.DBConnectionString = ComFunc.nvl(p[DomainKey.CONFIG, "DefaultConnection"]); bool bvalue = true; foreach (var item in MyConfig.GetConfigurationList("EFFC")) { if (bool.TryParse(ComFunc.nvl(item.Value), out bvalue)) { p[DomainKey.CONFIG, item.Key] = bool.Parse(ComFunc.nvl(item.Value)); } else if (DateTimeStd.IsDateTime(item.Value)) { p[DomainKey.CONFIG, item.Key] = DateTimeStd.ParseStd(item.Value).Value; } else { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } } }
protected override bool CheckMyParametersAndConfig(ConsoleParameter p, ConsoleData d) { foreach (var s in MyConfig.GetConfigurationList("Mail")) { p[DomainKey.CONFIG, $"Mail_{s.Key}"] = s.Value; } return(true); }
protected override void LoadConfig(WebParameter p, GoData d) { base.LoadConfig(p, d); bool bvalue = true; foreach (var item in MyConfig.GetConfigurationList("Weixin")) { if (bool.TryParse(ComFunc.nvl(item.Value), out bvalue)) { p[DomainKey.CONFIG, item.Key] = bool.Parse(ComFunc.nvl(item.Value)); } else if (DateTimeStd.IsDateTime(item.Value)) { p[DomainKey.CONFIG, item.Key] = DateTimeStd.ParseStd(item.Value).Value; } else { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } } }
protected override ParameterStd ConvertParameters(object[] obj) { var p = new ConsoleParameter(); if (obj != null & obj.Length > 0) { var command = ComFunc.nvl(obj[0]).ToLower(); if (command == "stop") { p.ExtentionObj.stop = true; } } //config foreach (var item in MyConfig.GetConfigurationList("ConnectionStrings")) { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } p.DBConnectionString = ComFunc.nvl(p[DomainKey.CONFIG, "DefaultConnection"]); bool bvalue = true; foreach (var item in MyConfig.GetConfigurationList("EFFC")) { if (bool.TryParse(ComFunc.nvl(item.Value), out bvalue)) { p[DomainKey.CONFIG, item.Key] = bool.Parse(ComFunc.nvl(item.Value)); } else if (DateTimeStd.IsDateTime(item.Value)) { p[DomainKey.CONFIG, item.Key] = DateTimeStd.ParseStd(item.Value).Value; } else { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } } return(p); }
protected override ParameterStd ConvertParameters(object[] obj) { var p = new ConsoleParameter(); if (obj != null & obj.Length > 0) { var la = ComFunc.nvl(obj[0]).Split('.', StringSplitOptions.RemoveEmptyEntries); p.CallLogicName = la.Length > 0 ? la[0] : ""; p.CallAction = la.Length > 1 ? la[1] : ""; } //config foreach (var item in MyConfig.GetConfigurationList("ConnectionStrings")) { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } p.DBConnectionString = ComFunc.nvl(p[DomainKey.CONFIG, "DefaultConnection"]); bool bvalue = true; foreach (var item in MyConfig.GetConfigurationList("EFFC")) { if (bool.TryParse(ComFunc.nvl(item.Value), out bvalue)) { p[DomainKey.CONFIG, item.Key] = bool.Parse(ComFunc.nvl(item.Value)); } else if (DateTimeStd.IsDateTime(item.Value)) { p[DomainKey.CONFIG, item.Key] = DateTimeStd.ParseStd(item.Value).Value; } else { p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value); } } return(p); }