Beispiel #1
0
 public ICollection <Project> GetProjects()
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Project>().OrderBy(x => x.Id).ToList());
     }
 }
Beispiel #2
0
 public Models.Action GetAction(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Models.Action>().Find(id));
     }
 }
Beispiel #3
0
 public User GetUser(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <User>().Find(id));
     }
 }
Beispiel #4
0
 public ICollection <Models.Action> GetMyActions()
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Models.Action>().Where(x => x.Uid == _currentUser.Id).OrderBy(x => x.Id).ToList());
     }
 }
Beispiel #5
0
 public Models.Action GetMyAction(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Models.Action>().Where(x => x.Uid == _currentUser.Id && x.Id == id).OrderBy(x => x.Id).FirstOrDefault());
     }
 }
Beispiel #6
0
 public Record GetMyRecord(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Record>().Where(x => x.Uid == _currentUser.Id && x.Id == id).FirstOrDefault());
     }
 }
Beispiel #7
0
 public ICollection <Models.Action> GetOpenActions()
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Models.Action>().Where(x => x.Status == ActionStatus.Open).OrderBy(x => x.Id).ToList());
     }
 }
Beispiel #8
0
 public Record GetRecord(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Record>().Find(id));
     }
 }
Beispiel #9
0
 public Field GetField(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Field>().Find(id));
     }
 }
Beispiel #10
0
 public Project GetProject(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Project>().Find(id));
     }
 }
Beispiel #11
0
 public ICollection <Record> GetMyRecords(DateTime?date)
 {
     if (date == null)
     {
         date = DateTime.UtcNow.Date;
     }
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Record>().Where(x => DbFunctions.TruncateTime(x.Create) == date && x.Uid == _currentUser.Id).OrderBy(x => x.Id).ToList());
     }
 }
Beispiel #12
0
 public ICollection <Field> GetFields(DateTime?date)
 {
     if (date == null)
     {
         date = DateTime.UtcNow.Date;
     }
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Field>().Where(x => x.Start <= date && x.End >= date).OrderBy(x => x.Id).ToList());
     }
 }