public ICollection <Project> GetProjects() { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <Project>().OrderBy(x => x.Id).ToList()); } }
public Models.Action GetAction(int id) { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <Models.Action>().Find(id)); } }
public User GetUser(int id) { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <User>().Find(id)); } }
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()); } }
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()); } }
public Record GetMyRecord(int id) { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <Record>().Where(x => x.Uid == _currentUser.Id && x.Id == id).FirstOrDefault()); } }
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()); } }
public Record GetRecord(int id) { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <Record>().Find(id)); } }
public Field GetField(int id) { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <Field>().Find(id)); } }
public Project GetProject(int id) { using (var _dbContext = new DailyReportsContext()) { return(_dbContext.Set <Project>().Find(id)); } }
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()); } }
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()); } }