Inheritance: System.Data.Linq.DataContext
Exemple #1
0
        static void Main(string[] args)
        {
            var reader = XmlReader.Create("http://blog.folketsting.dk/feed/");
            var feed = SyndicationFeed.Load<SyndicationFeed>(reader);

            var db = new DBDataContext();
            foreach (var item in feed.Items)
            {
                var post = db.BlogPosts.SingleOrDefault(_ => _.WordpressId == item.Id);
                if (post != null)
                {
                    post.Title = item.Title.Text;
                    post.Summary = item.Summary.Text;
                    post.PermaLink = item.Links[0].Uri.AbsoluteUri;
                    db.SubmitChanges();
                }
                else
                {
                    post = new BlogPost()
                    {
                        WordpressId = item.Id,
                        Title = item.Title.Text,
                        Summary = item.Summary.Text,
                        Date = item.PublishDate.DateTime,
                        PermaLink = item.Links[0].Uri.AbsoluteUri,
                    };
                    db.BlogPosts.InsertOnSubmit(post);
                }
                db.SubmitChanges();
            }
            Console.WriteLine("press the any key ...");
            Console.ReadKey();
        }
Exemple #2
0
        public void LawRepository_TopDebated()
        {
            DBDataContext db = new DBDataContext();
            foreach (var lv in db.PoliticianLawVotes.Take(100))
            {
                //Trace.WriteLine(lv.Politician.Party.Initials);
            }

            foreach (var p in db.Parties)
            {
                //Trace.WriteLine(p.Initials);
            }

            var foo = from plw in db.PoliticianLawVotes
                      join p in db.Politicians on plw.PoliticianId equals p.PoliticianId
                      where plw.LawVoteId == 421 //&& plw.Vote == votetype
                      group plw by new { p.Party.Initials, plw.Vote } into ps
                      orderby ps.Key.Initials
                      select new PartyVote()
                      {
                          Party = ps.Key.Initials,
                          Vote = ps.Key.Vote.Value,
                          Count = ps.Count()
                      };

            foreach (var item in foo)
            {
                Trace.WriteLine(item.Party);
            }
        }
Exemple #3
0
        public ActionResult Details(string uname)
        {
            var db = new DBDataContext();
            User u = db.Users.Where(_ => _.Username.ToLower() == uname.ToLower()).Single();

            return View("Details", new UserViewModel() { User = u});
        }
Exemple #4
0
 public void Test2338()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2009);
     P20QuestionScraper.GetQChecked(2338, "", new List<string>() { "" },
         true, "/samling/20091/spoergsmaal/S2338/index.htm", samling, false);
 }
Exemple #5
0
 public void Test22()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2010);
     P20QuestionScraper.GetQChecked(22,
         "Er det udtryk for uenighed i Venstre, når den tidligere undervisningsminister i januar 2010 afviste offentliggørelse bl.a. med afsæt i forskningsresultater samt negative erfaringer fra det engelske skolesystem?",
         new List<string>() { "Uddannelsesudvalget" },
         true, "/samling/20101/spoergsmaal/S22/index.htm", samling, false);
 }
Exemple #6
0
 public static int CommentCount(this LawChange thec)
 {
     using (DBDataContext db = new DBDataContext())
     {
         return db.Comments.Count(c =>
                 c.ItemId == thec.LawChangeId &&
                 c.CommentType == CommentType.Change);
     }
 }
Exemple #7
0
 public void TestL196_2009()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2009);
     Scrape2009.GetLaw("L 96", "Forslag til lov om ændring af lov om detailsalg fra butikker m.v. (Liberalisering af reglerne om åbningstid).",
         "Økonomi- og Erhvervsministeriet",
         "Erhvervsudvalget (ERU)", "Stadfæstet",
         "/samling/20091/lovforslag/L96/index.htm", samling, null, null, null, false);
 }
Exemple #8
0
 public void TestL12_2009()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2009);
     Scrape2009.GetLaw("L 12", "Forslag til lov om ændring af lov om registrering af ledningsejere. (Udvidelse af dækningsområde m.v.).",
         "Økonomi- og Erhvervsministeriet",
         "Erhvervsudvalget (ERU)", "Stadfæstet",
         "/samling/20091/lovforslag/L12/index.htm", samling, null, null, null, false);
 }
Exemple #9
0
 public static int CommentCount(this Section thes)
 {
     using (DBDataContext db = new DBDataContext())
     {
         return db.Comments.Count(c =>
             c.ItemId == thes.SectionId &&
                 c.CommentType == CommentType.Section);
     }
 }
Exemple #10
0
        public static int? DownloadDocument(string url, FT.DB.P20Question question)
        {
            //make sure url is normalized
            url = url.Trim().ToLower();

            // check to see if we already have document downloaded from this Uri
            var db = new DBDataContext();
            var doc = db.Documents.SingleOrDefault(d => d.Uri == url);
            if (doc != null)
            {
                return doc.DocumentId;
            }

            try
            {
                HttpWebResponse resp = GetResponse(url, 0);

                byte[] arrBuffer = new byte[0];
                using (BinaryReader reader = new BinaryReader(resp.GetResponseStream()))
                {
                    byte[] arrScratch = null;
                    while ((arrScratch = reader.ReadBytes(4096)).Length > 0)
                    {
                        if (arrBuffer.Length == 0)
                            arrBuffer = arrScratch;
                        else
                        {
                            byte[] arrTemp = new byte[arrBuffer.Length + arrScratch.Length];
                            Array.Copy(arrBuffer, arrTemp, arrBuffer.Length);
                            Array.Copy(arrScratch, 0, arrTemp, arrBuffer.Length, arrScratch.Length);
                            arrBuffer = arrTemp;
                        }
                    }
                }

                Binary bin = new Binary(arrBuffer);

                FT.DB.Document newdoc = new DB.Document();

                newdoc.Data = bin;
                newdoc.ContentType = resp.ContentType;
                newdoc.Uri = url;

                var scribdids = UpLoadToScribd(url, question);
                newdoc.ScribdId = scribdids.Item1;
                newdoc.ScribdAccessKey = scribdids.Item2;

                db.Documents.InsertOnSubmit(newdoc);
                db.SubmitChanges();

                return newdoc.DocumentId;
            }
            catch (Exception e)
            {
                return null;
            }
        }
Exemple #11
0
 public static int CommentCount(this SpeechPara thesp)
 {
     using (DBDataContext db = new DBDataContext())
     {
         return db.Comments.Count(c =>
                 c.ItemId == thesp.SpeechParaId &&
                     c.CommentType == CommentType.Speech);
     }
 }
Exemple #12
0
 public void Test2566()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2009);
     P20QuestionScraper.GetQChecked(2695,
         "Bekymrer det ikke ministeren, at UNI-C har monopol på udbud af it-styresystemet Easy-a til erhvervsskolerne, og at det dermed både kan sætte prisen selv og ikke udsættes for konkurrence til hele tiden at udvikle billigere og bedre systemer?",
         new List<string>() { "Uddannelsesudvalget" },
         true, "/samling/20091/spoergsmaal/S2566/index.htm", samling, false);
 }
Exemple #13
0
 public void Test1990()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2010);
     P20QuestionScraper.GetQChecked(1990,
         "",
         new List<string>() { "" },
         true, "/samling/20101/spoergsmaal/S1990/index.htm#dok", samling, false);
 }
Exemple #14
0
 public void TestL150_2010()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2010);
     Scrape2009.GetLaw("L 150",
             "Forslag til lov om ændring af lov om finansiel virksomhed. (Udvidelse af hjemmel til at videregive informa- tion til færøske og grønlandske myndigheder).",
             "Økonomi- og Erhvervsministeriet",
             "Færøudvalget (FÆU)", "1. beh./Henvist til udvalg",
             "/samling/20101/lovforslag/L150/index.htm#dok", samling, null, null, null, false);
 }
Exemple #15
0
 public void TestL11_2010()
 {
     var db = new DBDataContext();
     var samling = db.Sessions.Single(_ => _.Number == 1 && _.Year == 2010);
     Scrape2009.GetLaw("L 11",
             "Forslag til lov om ændring af lov om miljøbeskyttelse. (Gennemførelse af EU-regler om fremme af renere og mere energieffektive køretøjer til vejtransport m.v.).",
             "Miljøministeriet",
             "Miljø- og Planlægningsudvalget (MPU)", "Stadfæstet",
             "/samling/20101/lovforslag/L11/index.htm#dok", samling, null, null, null, false);
 }
        public void DeleteAllDocs()
        {
            var db = new DBDataContext();

            foreach (var d in db.Documents)
            {
                if (d.ScribdId.Value != 35896972)
                {
                    Scribd.Net.Document.Delete(d.ScribdId.Value);
                }
                db.Documents.DeleteOnSubmit(d);
            }
            db.SubmitChanges();
        }
        public void AddAccessKeyToAllScribdDocs()
        {
            int pagesize = 100;

            Scribd.Net.Service.APIKey = "6qoqzj285ftfmvddexcpb";
            Scribd.Net.Service.SecretKey = "sec-6hrkkevcf77mmn34uz73csjmo7";
            Scribd.Net.Service.EnforceSigning = true;
            Scribd.Net.Service.PublisherID = "pub-82439046238225493803";

            //Scribd.Net.Search.Criteria crit = new Scribd.Net.Search.Criteria();
            //crit.Scope = Scribd.Net.SearchScope.Account;
            //crit.MaxResults = pagesize;
            //crit.StartIndex = 1;
            //crit.Query = "Svar";

            var db = new DBDataContext();

            //foreach (var doc in docs)
            //{
            //    var dbdoc = db.Documents.Single(d => d.ScribdId == doc.DocumentId);
            //    dbdoc.ScribdAccessKey = doc.AccessKey;
            //}

            //Scribd.Net.Search.Result res = null;
            List<Scribd.Net.Document> res = null;
            int offset = 0;
            do
            {
                //res = Scribd.Net.Search.Find(crit);
                res = Scribd.Net.Document.GetList(Scribd.Net.Service.User, pagesize, offset, false);

                foreach (var doc in res)
                {
                    var dbdoc = db.Documents.Single(d => d.ScribdId == doc.DocumentId);
                    if (dbdoc.ScribdAccessKey == null)
                    {
                        dbdoc.ScribdAccessKey = doc.AccessKey;
                    }
                }

                //Console.WriteLine("Updated" + res.Documents.Count);
                //Thread.Sleep(5000);

                //crit.StartIndex += pagesize;
                offset += res.Count;
            }
            while (res.Count > 0);

            db.SubmitChanges();
        }
Exemple #18
0
 public ActionResult Index()
 {
     var db = new DBDataContext();
     var laws = db.Laws.Where(l => l.SessionId == 2 || l.SessionId == 3 || l.SessionId == 1);
     var pols = db.Politicians.Where(p => p.FullName().ToLower() != "formanden");
     var lastweek = DateTime.Now.AddDays(-7);
     return View("Index", new FrontpageViewModel()
     {
         News = db.BlogPosts.OrderByDescending(bp => bp.Date).Take(5),
         MostDebated = _polRep.MostDebated(lastweek, 10),
         Proposed = _lawRep.RecentProposed(10),
         Breadcrumb = new List<Breadcrumb> { Breadcrumb.Home },
         MetaDescription = "Folkets Ting er demokrati som hjemmeside"
     });
 }
 public static int CommentCount(this P20Question q)
 {
     DBDataContext db = new DBDataContext();
     return
         (
         from c in db.Comments
         join ap in db.AnswerParas on c.ItemId equals ap.AnswerParaId
         where ap.QuestionId == q.P20QuestionId && c.CommentType == CommentType.Answer
         select c.CommentId
         ).Concat(
         from c in db.Comments
         where c.ItemId == q.P20QuestionId &&
             (c.CommentType == CommentType.Question || c.CommentType == CommentType.QuestionBackground)
         select c.CommentId
         ).Count();
 }
 public static User User(this Controller con)
 {
     if (con.User.Identity.IsAuthenticated)
     {
         if (!usercache.ContainsKey(con.User.Identity.Name))
         {
             var db = new DBDataContext();
             User theu = db.Users.SingleOrDefault(u => u.Username == con.User.Identity.Name);
             if (theu != null)
                 usercache[con.User.Identity.Name] = theu;
             else return null;
         }
         return usercache[con.User.Identity.Name];
     }
     else
     {
         return null;
     }
 }
Exemple #21
0
        public static void GeoCode()
        {
            var db = new DBDataContext();

            foreach (var trip in db.CommitteeTrips.Where(_ => !_.CommitteeTripDestinations.Any()))
            {
                if (!string.IsNullOrEmpty(trip.Place))
                {
                    Console.WriteLine("geocoding " + trip.Place);
                    string[] dests = { };
                    if (trip.Place.Contains(" og "))
                    {
                        dests = trip.Place.Split(
                            new string[] { ",", "og" }, StringSplitOptions.RemoveEmptyEntries)
                            .Select(_ => _.Trim()).ToArray();
                    }
                    else
                    {
                        dests = new string[] { trip.Place };
                    }

                    var poss = dests.Select(_ => new { pos = Geo.Geocoder.GeoCode(_, false), place = _ });
                    var destinations = poss.Where(_ => _.pos != null).Select(_ => new CommitteeTripDestination
                    {
                        CommitteeTripId = trip.CommitteeTripId,
                        Lat = _.pos.Lat,
                        Lng = _.pos.Lng,
                        PlaceNameName = _.place.Trim()
                    });
                    db.CommitteeTripDestinations.InsertAllOnSubmit(destinations);
                }
            }
            db.SubmitChanges();

            Console.WriteLine("all done");
        }
        public ActionResult All()
        {
            var db = new DBDataContext();
            var vm = new PoliticiansViewModel() { Politicians = db.Politicians.OrderBy(p => p.Firstname) };
            vm.Breadcrumb = new List<Breadcrumb>() {
                    Breadcrumb.Home,
                    Breadcrumb.PolIndex,
                    new Breadcrumb("Alle politikere", "Politician", "All")};

            vm.MetaDescription = "Alle politikere på Folkets Ting";
            return View("All", vm);
        }
 public static int Views(this Politician p)
 {
     using (DBDataContext db = new DBDataContext())
     {
         // hopefully, this will discount two in same minute from same IP
         return (from v in db.Hits
                 where v.ContentType == ContentType.Politician && v.ContentId == p.PoliticianId
                 group v by new { v.IP, v.Date.Date, v.Date.Hour, v.Date.Minute } into v2
                 select v2.Key).Count();
     }
 }
 public static int CommentCount(this Politician thep)
 {
     using (DBDataContext db = new DBDataContext())
     {
         return (from c in db.Comments
                 join sp in db.SpeechParas on c.ItemId equals sp.SpeechParaId
                 join s in db.Speeches on sp.SpeechId equals s.SpeechId
                 where s.PoliticianId == thep.PoliticianId &&
                     c.CommentType == CommentType.Speech
                 select c.CommentId).Concat(
                     from c in db.Comments
                     join ap in db.AnswerParas on c.ItemId equals ap.AnswerParaId
                     join q in db.P20Questions on ap.QuestionId equals q.P20QuestionId
                     where q.AskeeId == thep.PoliticianId &&
                         c.CommentType == CommentType.Answer
                     select c.CommentId).Concat(
                         from c in db.Comments
                         join q in db.P20Questions on c.ItemId equals q.P20QuestionId
                         where (c.CommentType == CommentType.Question ||
                             c.CommentType == CommentType.QuestionBackground) &&
                             q.AskerPolId == thep.PoliticianId
                         select c.CommentId)
                 .Count();
     }
 }
        public ActionResult Register(string userName, string email, string password, 
            string confirmPassword, string returnurl)
        {
            ViewData["PasswordLength"] = MembershipService.MinPasswordLength;

            if (ValidateRegistration(userName, email, password, confirmPassword))
            {
                MembershipCreateStatus createStatus = MembershipCreateStatus.ProviderError;
                // Attempt to register the user
                //using (TransactionScope ts = new TransactionScope())
                //{
                createStatus =
                    MembershipService.CreateUser(userName, password, email);

                if (createStatus == MembershipCreateStatus.Success)
                {
                    FormsAuth.SignIn(userName, false /* createPersistentCookie */);
                    // also create our user
                    var db = new DBDataContext();
                    MembershipUser newuser = Membership.GetUser();
                    db.Users.InsertOnSubmit(new User()
                    {
                        Username = userName,
                        CreatedOn = DateTime.Now,
                        //aspnetuserid = (Guid)newuser.ProviderUserKey,
                    });

                    db.SubmitChanges();

                    //ts.Complete();
                    if(!string.IsNullOrEmpty(returnurl))
                        return Redirect(Server.UrlDecode(returnurl));
                    else
                        return RedirectToAction("Index", "Home");
                }

                else
                {
                    ModelState.AddModelError("_FORM", ErrorCodeToString(createStatus));
                }
                //    ts.Complete();
                //}
            }

            // If we got this far, something failed, redisplay form
            return View();
        }
        public ActionResult New(
            [Bind(Prefix = "ApiUser", Include = "EmailAddress,IntendedUse")]
            ApiUser user,
            bool captchaValid
            )
        {
            if (!captchaValid)
            {
                ViewData.ModelState.AddModelError("captcha", "CAPTCHA forkert");
            }

            if (string.IsNullOrEmpty(user.EmailAddress))
            {
                ViewData.ModelState.AddModelError("ApiUser.EmailAddress", "Ingen email adresse angivet");
            }

            var db = new DBDataContext();
            if (db.ApiUsers.Any(_ => _.EmailAddress == user.EmailAddress))
            {
                ViewData.ModelState.AddModelError("ApiUser.EmailAddress", "Email adresse findes allerede, skriv til [email protected] hvis du glemt nøgle");
            }

            if (!ModelState.IsValid)
            {
                // try again
                return View("New", new NewApiUserViewModel
                    {
                        Breadcrumb = new List<Breadcrumb>
                        {
                            Breadcrumb.Home,
                        },
                        MetaDescription = "Lav API-nøgle til Folkets Ting API",
                        ApiUser = user,
                    });
            }
            else
            {
                // we have a live one
                string apikey = GetKey(apiKeyLength);
                // make sure the apikey is distinct

                while(db.ApiUsers.Any(_ => _.ApiKey == apikey))
                {
                    apikey = GetKey(apiKeyLength);
                }

                user.ApiKey = apikey;
                user.CreatedDate = DateTime.Now;

                db.ApiUsers.InsertOnSubmit(user);
                db.SubmitChanges();

                return RedirectToAction("Created", "ApiRegistration", new { key = apikey });
            }
        }
Exemple #27
0
        //public static void ExportCommittees()
        //{
        //    var db = new DBDataContext();
        //    var coms = from ct in db.CommitteeTrips
        //               join c in db.Committees on ct.CommitteeId equals c.CommitteeId
        //               group c by c.Name into g
        //               select new { Name = g.Key, Ammount = g.Sum(_ =>  };
        //    var eng = new FileHelperEngine<TripExport>();
        //    eng.WriteFile("trips.csv", trips.OrderByDescending(_ => _.Expense));
        //    //ExportPols(getammount, db, tripPolAmmounts);
        //}
        public static void ExportPols()
        {
            var db = new DBDataContext();
            var tripPolAmmounts = new Dictionary<int, decimal>();
            foreach (var t in db.CommitteeTrips.ToList())
            {
                tripPolAmmounts.Add(
                               t.CommitteeTripId,
                               (getammount(t))
                               / ((decimal)(t.CommitteeTripParticipants.Count
                                    + t.NonPolParticipants))
                           );
            }

            var trippols = db.Politicians.Select(_ =>
                    new { _.Firstname, _.Lastname, _.CommitteeTripParticipants }).ToList().
                    Where(p => p.CommitteeTripParticipants.
                        Where(_ => tripfilter(_.CommitteeTrip)).Sum(
                        ctp => getammount(ctp.CommitteeTrip)) > 0);

            IEnumerable<PolExport> pols = trippols.Select(tp =>
                new PolExport
                {
                    Name = tp.Firstname + " " + tp.Lastname,
                    NumTrips = tp.CommitteeTripParticipants.
                        Where(_ => tripfilter(_.CommitteeTrip)).Count(),
                    TripPlaces = tp.CommitteeTripParticipants.
                        Where(_ => tripfilter(_.CommitteeTrip)).
                        Select(_ => _.CommitteeTrip.Place).ToList().Aggregate((a, b) => a + ", " + b),
                    Expenses = tp.CommitteeTripParticipants.
                        Where(_ => tripfilter(_.CommitteeTrip)).
                        Sum(_ => tripPolAmmounts[_.CommitteeTripId])
                }
            );

            var eng = new FileHelperEngine<PolExport>();
            eng.WriteFile("polsbyammount.csv", pols.OrderByDescending(_ => _.Expenses));
        }
Exemple #28
0
        public static void ExportCommittees()
        {
            var db = new DBDataContext();

            var coms = db.Committees.ToList().Select(c =>
                new CommitteeExport
                {
                    TotalSpent = c.CommitteeTrips.Sum(ct => getammount(ct)),
                    CommitteeName = c.Name,
                    TripCount = c.CommitteeTrips.Count()
                    //Politicians = c.CommitteeTrips.SelectMany(ct =>
                    //    ct.CommitteeTripParticipants.Select(ctp =>
                    //        ctp.Politician.Firstname + " " + ctp.Politician.Lastname)).
                    //        Aggregate((a,b) => a + ", " + b)
                }
                );

            var eng = new FileHelperEngine<CommitteeExport>();
            eng.WriteFile("allcoms.csv", coms.OrderByDescending(_ => _.TotalSpent));
        }
Exemple #29
0
        public static void Export()
        {
            var db = new DBDataContext();
            IEnumerable<TripExport> trips = db.CommitteeTrips.Where(t => tripfilter(t)).ToList().Select(_ =>
                new TripExport
                {
                    Budget = _.Budget.Value,
                    Expense = _.ActualExpenses.Value,
                    OtherParticpantCount = _.NonPolParticipants.Value,
                    ParticipantNames =
                        _.CommitteeTripParticipants.ToList().
                        Select(p => p.Politician.Firstname + " " + p.Politician.Lastname).
                        ToList().
                        Aggregate((a, b) => a + ", " + b).Escape(),
                    Place = _.Place.Escape(),
                    PolParticipantCount = _.CommitteeTripParticipants.Count,
                    Purpose = _.Purpose.Escape(),
                    TotalParticipantCount = _.CommitteeTripParticipants.Count + _.NonPolParticipants.Value,
                    url = string.Format(
                    "http://www.ft.dk/Folketinget/udvalg_delegationer_kommissioner/Udvalg/Det_energipolitiske_udvalg/Rejser/Vis.aspx?itemid={0}",
                    "{" + _.FTId + "}"),
                    Excess = (_.Budget.Value != 0 && _.ActualExpenses.Value != 0) ?
                        ((_.ActualExpenses.Value - _.Budget.Value) / _.Budget.Value) * 100 : 0,
                });

            var eng = new FileHelperEngine<TripExport>();
            eng.WriteFile("trips.csv", trips.OrderByDescending(_ => _.Expense));

            //ExportPols(getammount, db, tripPolAmmounts);
        }
Exemple #30
0
        public static void Compute()
        {
            var db = new DBDataContext();

            Func<CommitteeTrip, decimal> getammount = t => t.ActualExpenses.Value == 0 ? t.Budget.Value : t.ActualExpenses.Value;

            var tripPolAmmounts = new Dictionary<int, decimal>();

            foreach (var t in db.CommitteeTrips)
            {
                tripPolAmmounts.Add(
                               t.CommitteeTripId,
                               (getammount(t))
                               / ((decimal)(t.CommitteeTripParticipants.Count + t.NonPolParticipants))
                           );
            }

            var pols = db.Politicians.ToList().Select(p => new
            {
                Name = p.Firstname + " " + p.Lastname,
                Ammount = p.CommitteeTripParticipants.
                    Sum(_ => tripPolAmmounts[_.CommitteeTripId]),
                Pol = p,
            });

            Console.WriteLine("Starting...");
            foreach (var p in pols.Where(_ => _.Ammount > 0).OrderByDescending(_ => _.Ammount))
            {
                Console.WriteLine(p.Name + " " + p.Ammount);
                foreach (var part in p.Pol.CommitteeTripParticipants)
                {
                    Console.WriteLine("    " +
                        part.CommitteeTrip.Place + " " +
                        getammount(part.CommitteeTrip));
                }

            }
            Console.WriteLine("please press the any key");
            Console.ReadKey();
        }