Beispiel #1
0
 public static Task<List<CalculatedRatingCoefficient>> GetCalculatedRatingCoefficients()
 {
     var task = new TaskCompletionSource<List<CalculatedRatingCoefficient>>();
     var cee = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
     cee.GetCalculatedRatingCoefficientsCompleted += (s, e) => task.SetResult(e.Result);
     cee.GetCalculatedRatingCoefficientsAsync();
     return task.Task;
 }
        private void LoadCalculatedRankingCoefficients(NodeView currentNodeView)
        {
            CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);

            cmsWebServiceClient.GetCalculatedRatingCoefficientsCompleted += (s1, e1) =>
            {
                foreach (CalculatedRatingCoefficient coefficient in e1.Result)
                {
                    NodeView child = new NodeView(currentNodeView)
                    {
                        Id = coefficient.Id,
                        Name = coefficient.Name,
                        Description = coefficient.Value.ToString(),
                        //IsActive = Coefficient.IsActive,
                        Icon = "/CmsEquipmentDatabase;component/Images/Configuration.png",
                        Type = NodeType.CoefficientNode,
                        SortField = coefficient.Ordinal.ToString(),
                        HasChildren = false
                    };
                    currentNodeView.Children.Add(child);
                }
                Utils.HideSpinner(currentNodeView);
                currentNodeView.Sort();
            };
            cmsWebServiceClient.GetCalculatedRatingCoefficientsAsync();
        }