Esempio n. 1
0
 public ICollection <Project> GetProjects()
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Project>().OrderBy(x => x.Id).ToList());
     }
 }
Esempio n. 2
0
 public Models.Action GetAction(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Models.Action>().Find(id));
     }
 }
Esempio n. 3
0
 public User GetUser(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <User>().Find(id));
     }
 }
Esempio n. 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());
     }
 }
Esempio n. 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());
     }
 }
Esempio n. 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());
     }
 }
Esempio n. 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());
     }
 }
Esempio n. 8
0
 public Record GetRecord(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Record>().Find(id));
     }
 }
Esempio n. 9
0
 public Field GetField(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Field>().Find(id));
     }
 }
Esempio n. 10
0
 public Project GetProject(int id)
 {
     using (var _dbContext = new DailyReportsContext())
     {
         return(_dbContext.Set <Project>().Find(id));
     }
 }
Esempio n. 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());
     }
 }
Esempio n. 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());
     }
 }