/// <summary>${IS6_GetBusSolutionService_method_ProcessAsync_D}</summary> /// <param name="parameters">${IS6_GetBusSolutionService_method_ProcessAsync_param_Parameters}</param> /// <param name="state">${IS6_GetBusSolutionService_method_ProcessAsync_param_state}</param> public void ProcessAsync(GetBusSolutionParameters parameters, object state) { if (parameters == null) { //TODO:资源 throw new ArgumentNullException(ExceptionStrings.ArgumentIsNull); //throw new ArgumentNullException("GetBusSolutionByIDsParameters is Null"); } if (string.IsNullOrEmpty(this.Url)) { //TODO:资源 throw new InvalidOperationException(ExceptionStrings.InvalidUrl); //throw new InvalidOperationException("Url is not set"); } base.SubmitRequest(base.Url + "/path.ashx?", GetParameters(parameters), new EventHandler<RequestEventArgs>(request_Completed), state, false); }
private Dictionary<string, string> GetParameters(GetBusSolutionParameters parameters) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); if (parameters.IDs != null && parameters.IDs.Count > 0) { string method = "GetBusSolutionByIds"; dictionary.Add("method", method); dictionary.Add("ids", JsonHelper.FromIList((List<int>)parameters.IDs)); } else { string method = "GetBusSolutionByNames"; dictionary.Add("method", method); string json = "["; List<string> list = new List<string>(); for (int i = 0; i < parameters.Names.Count; i++) { list.Add(string.Format("\"{0}\"", parameters.Names[i])); } json += string.Join(",", list.ToArray()); json += "]"; dictionary.Add("names", json); } dictionary.Add("map", parameters.MapName); dictionary.Add("busSolutionParam", BusSolutionParam.ToJson(parameters.BusSolutionParam)); return dictionary; }
/// <summary>${IS6_GetBusSolutionService_method_ProcessAsync_D}</summary> /// <overloads>${IS6_GetBusSolutionService_method_ProcessAsync_overloads_D}</overloads> public void ProcessAsync(GetBusSolutionParameters parameters) { ProcessAsync(parameters, null); }