Beispiel #1
0
        public ProjektCollection GetUntergeordneteProjekte(int ProjektID)
        {
            string pNumber = string.Empty;
            var    buf     = from n in db.projekte
                             where n.id == ProjektID
                             select n.ursprungsprojekt;

            pNumber = buf.FirstOrDefault();

            // pNumber = db.projekte.Where(p => p.id == ProjektID).FirstOrDefault().ursprungsprojekt;  // wirft Exception wenn ProjektId = 0;

            if (pNumber == string.Empty || pNumber == null)
            {
                return(null);
            }



            var ur = from up in db.projekte
                     where up.ursprungsprojekt == pNumber
                     select up;

            var pc = new ProjektCollection(ur, this.db);

            return(pc);
        }
        public ProjektCollection GetAlleProjekte()
        {
            var result = from p in db.projekte.Include("projekt_verlauf")
                         select p;
            var pc = new ProjektCollection(result, this.db);

            return(pc);
        }
        public ProjektCollection GetLikeTest()
        {
            var test = from p in db.projekte
                       where p.projektnummer.Contains("111")
                       select p;
            var res = new ProjektCollection(test, db);

            return(res);
        }
        public ProjektCollection GetLeerprojekt()
        {
            var result = from p in db.projekte
                         where p.id == 0
                         select p;
            var pc = new ProjektCollection(result, this.db);

            return(pc);
        }
        public ProjektCollection GetProjekteListe()
        {
            var result = from p in db.projekte
                         where p.datum >= new DateTime(2011, 05, 1) orderby p.projektnummer descending
                         select p;

            var pc = new ProjektCollection(result, this.db);

            return(pc);
        }
        public ProjektCollection GetLikeTest2()
        {
            var p = db.projekte
                    .Where("it.type = 'anlage' and it.firmenname = 'Jets As'")
                    .OrderBy("it.projektnummer desc");

            var res = new ProjektCollection(p.Skip(4).Take(3), db);

            return(res);
        }
        public ProjektCollection GetProjekteByID(int ProjektID)
        {
            var result = from p in db.projekte              //.Include("projekt_verlauf")
                         where p.id == ProjektID
                         select p;

            var pc = new ProjektCollection(result, this.db);

            return(pc);
        }
Beispiel #8
0
        public void TestInitialize()
        {
            dbConnection = new DbConnection();
            checks       = new Checks();

            projektCollection = ProjektCollection._instance;
            startdate         = new DateTime(2018, 01, 01);

            finaldate        = new DateTime(2018, 05, 01);
            medarbejder      = new Employee("Erik", 2);
            dataManegment    = new DataManegment();
            budgetContrainer = new BudgetContrainer();
        }
        public ProjektCollection GetProjekteListe(int page, int rowsPerPage)
        {
            int toSkip = (page - 1) * rowsPerPage;

            var result = from p in db.projekte
                         where p.datum >= new DateTime(2004, 01, 1)
                         orderby p.projektnummer descending
                         select p;

            var pc = new ProjektCollection(result.Skip(toSkip).Take(rowsPerPage), this.db);

            return(pc);
        }
        public ProjektCollection GetUntergeordneteProjekte(int ProjektID)
        {
            var buf = from n in db.projekte
                      where n.id == ProjektID
                      select n.projektnummer;

            string pNumber = buf.FirstOrDefault();

            var ur = from up in db.projekte
                     where up.ursprungsprojekt == pNumber
                     select up;

            var pc = new ProjektCollection(ur, this.db);

            return(pc);
        }
            public ProjektCollection GetProjektData(string filter, int toSkip, int toTake)
            {
                System.Data.Objects.ObjectQuery<projekt> p;
              

                if (filter == string.Empty || filter == null)
                {
                    p = db.projekte
                          .OrderBy("it.created desc");
                }
                else
                {
                    
                    p = db.projekte
                        .Where(filter)
                        .OrderBy("it.created desc");
                }

                RecordCount = p.Count();

                var res = new ProjektCollection(p.Skip(toSkip).Take(toTake), db);
                return res;
            }