Source

main / Source / Excel / Excel.BizLogic / Managers / ServiceManager.cs

Diff from to

File Source/Excel/Excel.BizLogic/Managers/ServiceManager.cs

 using System.Net;
 using System.Runtime.Serialization;
 using System.Text;
+using System.Linq;
 using System.Xml.Linq;
 using DataUp.Excel.Common;
 using DataUp.Web.Service.Model;
 using Ionic.Zip;
 using Microsoft.Office.Interop.Excel;
+using System.Security.Cryptography.X509Certificates;
 using Tools = Microsoft.Office.Tools.Excel;
+using System.Net.Security;
 
 namespace DataUp.Excel.BizLogic
 {
         {
             this.Workbook = workbook;
             this.Factory = factory;
+            ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
             this.service = new DataUpService.RepositoryDataContext(new Uri(Common.Constants.DcxlWebServiceLink));
         }
 
                 content.Add(metadata);
             }
 
-            content.Add(new DKeyValuePair<string, string>() { Key = "Profile", Value = Common.Constants.GetPostProfile});
+            content.Add(new DKeyValuePair<string, string>() { Key = "Profile", Value = Common.Constants.GetPostProfile });
             content.Add(new DKeyValuePair<string, string>() { Key = "who", Value = details.Who });
             content.Add(new DKeyValuePair<string, string>() { Key = "what", Value = details.What });
             content.Add(new DKeyValuePair<string, string>() { Key = "when", Value = details.When.ToString(Common.Constants.DefaultDateFormat) });
             // Update Parameters metadata values
 
             List<ParameterMetadataDetail> parameters = new List<ParameterMetadataDetail>();
-            foreach (var item in parameterMetadataList)
+
+            var paramData = from val in parameterMetadataList
+                            group val by val.EntityName into param
+                            select new
+                            {
+                                EntityName = param.Key,
+                                Description = param.Select(q => (String.IsNullOrEmpty(q.EntityDescription) ? "" : q.EntityDescription)).FirstOrDefault(q => !String.IsNullOrEmpty(q)),
+                                Values = param.ToList()
+                            };
+
+            foreach (var data in paramData)
             {
-                parameters.Add(new ParameterMetadataDetail()
+                parameters.Add(new ParameterMetadataDetail
                 {
-                    Name = item.Name,
-                    Description = item.Description,
-                    Type = item.Type,
-                    Units = item.Units
+                    EntityName = data.EntityName,
+                    EntityDescription = data.Description,
+                    AttributeList = data.Values.Select(q => new ParameterAttribute { Name = q.Name, Description = q.Description, Type = q.Type, Units = q.Units }).ToList()
+
                 });
             }
+
             queryData.ParameterMetadata = parameters.ToArray();
 
             return queryData;