Esempio n. 1
0
 public static void Error(Exception exception, string s, NetworkSetRequest req)
 {
     throw new NotImplementedException();
 }
Esempio n. 2
0
 public NetworkSetResponse GetNetworkSet(NetworkSetRequest req)
 {
     throw new NotImplementedException();
 }
Esempio n. 3
0
        private static void GetNetwork(ref string planCat, ref bool isS084, ref string planNetworkSet,
                                       ref string networkId, ref string classId, ref string planId, ref int groupKey)
        {
            NetworkSetRequest req = new NetworkSetRequest {
                ClassIdentifier = classId, ClassPlanIdentifier = planId, GroupKey = groupKey
            };

            // Get network id set
            NetworksClient nsClient = new NetworksClient();

            NetworkSetResponse response = new NetworkSetResponse();

            try
            {
                // Make the networks call
                response = nsClient.GetNetworkSet(req);

                // Close the channelw
                nsClient.Close();
            }
            catch (Exception ex) //System.ServiceModel.CommunicationException)
            {
                Log.Error(ex, $"Failed to get data from Networks.svc with req.ClassIdentifier = {req.ClassIdentifier}, req.ClassPlanIdentifier = {req.ClassPlanIdentifier}, req.GroupKey = {req.GroupKey}", req);
                nsClient.Abort();
            }

            var filtered = response.NetworkSet.Where(x =>
                                                     ((x.EffectiveDate <= DateTime.Today) && (x.TerminationDate >= DateTime.Today)) && (x.PlanEffectiveDate <= DateTime.Today) && (x.PlanTerminationDate >= DateTime.Today) && (x.CardStock != "NONE"));

            foreach (var n in filtered)
            {
                if (n.NetworkStatus.Contains("I") || ((n.NetworkStatus.Contains("P") && n.Id.Contains("A00005") && (n.Prefix.Contains("S065") || n.Prefix.Contains("S069")))))
                {
                    if (!planNetworkSet.Contains(n.Id.Trim()))
                    {
                        if ((n.Id.Contains("C00073") || n.Id.Contains("W00020")) && IsAcoPrefix(n.Prefix))
                        {
                            planNetworkSet += "";
                        }

                        else if ((n.Id.Contains("C00073") || n.Id.Contains("W00019")) && IsAcoPrime(n.Prefix))
                        {
                            planNetworkSet += "";
                        }

                        else if (n.Id.Contains("W00019") && IsVmPrime(n.Prefix))
                        {
                            planNetworkSet += "";
                        }

                        else if (n.Id.Contains("W00020") && IsVmAco(n.Prefix))
                        {
                            planNetworkSet += "";
                        }
                        else
                        {
                            planNetworkSet += n.Id.Trim() + ",";
                        }
                    }
                }

                if (!planCat.Contains(n.PlanCat.Trim()))
                {
                    planCat += n.PlanCat.Trim() + ",";
                }
            }
        }