Beispiel #1
0
 public static List <TTKunde> GetKunden()
 {
     using (var context = new MSUtilityDBEntities())
     {
         return((from c in context.TTKunde select c).Distinct().ToList());
     }
 }
Beispiel #2
0
 public static List <DateTime> GetCalenderEntries()
 {
     using (var context = new MSUtilityDBEntities())
     {
         return((from c in context.TTDates where c.Day.Month == StateManager.CurrentInstance.CurrentSelectedDate.Month && c.Day.Year == StateManager.CurrentInstance.CurrentSelectedDate.Year select c).Include("TTKundeEntry").ToList().Where(x => x.TTKundeEntry.Count != 0).Select(x => x.Day).ToList());
     }
 }
Beispiel #3
0
        public static List <TTProject> GetProjects(TTKundeEntry currentInstanceSelectedKundeEntry)
        {
            if (currentInstanceSelectedKundeEntry == null)
            {
                return(new List <TTProject>());
            }

            using (var context = new MSUtilityDBEntities())
            {
                return((from c in context.TTProject where c.KundeId == currentInstanceSelectedKundeEntry.KundeID select c).Distinct().ToList());
            }
        }
Beispiel #4
0
 public static TTDates GetDateDataFromDate(DateTime date)
 {
     using (var context = new MSUtilityDBEntities())
     {
         var result = context.TTDates
                      .Include("TTKundeEntry")
                      .Include("TTKundeEntry.TTKunde")
                      .Include("TTKundeEntry.TTProjectEntry")
                      .Include("TTKundeEntry.TTProjectEntry.TTProject")
                      .Include("TTKundeEntry.TTProjectEntry.TTEntryData").FirstOrDefault(x => x.Day == date.Date);
         return(result);
     }
 }
Beispiel #5
0
 public static List <TTDates> GetDateDataFromDateRange(DateTime from, DateTime to)
 {
     using (var context = new MSUtilityDBEntities())
     {
         var result = context.TTDates
                      .Include("TTKundeEntry")
                      .Include("TTKundeEntry.TTKunde")
                      .Include("TTKundeEntry.TTProjectEntry")
                      .Include("TTKundeEntry.TTProjectEntry.TTProject")
                      .Include("TTKundeEntry.TTProjectEntry.TTEntryData").Where(x => x.Day >= from && x.Day <= to)
                      .ToList();
         return(result);
     }
 }