private static void SendTodaysDistributions(string[] args) { // get company name string companyNameShort = null; foreach (string s in args) { if (s.ToUpper().StartsWith("/N")) { companyNameShort = s.Substring(2); break; } } // do stuff DistributionService.DistributionService distributionService = new DistributionService.DistributionService(); distributionService.Url = AppConfig.ReadSetting("DistributionServiceURL", ""); distributionService.Timeout = int.Parse(AppConfig.ReadSetting("DistributionServiceTimeout", "600000")); string user = AppConfig.ReadSetting("DistributionServiceUser", ""); string password = AppConfig.ReadSetting("DistributionServicePassword", ""); if (user != "") { distributionService.Credentials = new System.Net.NetworkCredential(user, password); } else { distributionService.Credentials = System.Net.CredentialCache.DefaultCredentials; } distributionService.EnqueueScheduledDistributions(companyNameShort); distributionService.AsyncSendQueuedDistributions(companyNameShort); }
private static void SendTodaysDistributions(string[] args) { // get company name string companyNameShort = GetArgumentByTag("N:", args); if (companyNameShort == null) { return; } // do stuff DistributionService.DistributionService distributionService = new DistributionService.DistributionService(); distributionService.Url = AppConfig.ReadSetting("DistributionServiceURL", ""); distributionService.Timeout = int.Parse(AppConfig.ReadSetting("DistributionServiceTimeout", "600000")); string user = AppConfig.ReadSetting("DistributionServiceUser", ""); string password = AppConfig.ReadSetting("DistributionServicePassword", ""); if (user != "") { distributionService.Credentials = new System.Net.NetworkCredential(user, password); } else { distributionService.Credentials = System.Net.CredentialCache.DefaultCredentials; } distributionService.EnqueueScheduledDistributions(companyNameShort); distributionService.AsyncSendQueuedDistributions(companyNameShort); }