public List <CounterValue> GetAllCounterValuesByAccountId(int personalAccountId) { using (var context = new CountersEntities()) { var counterValues = (from p in context.CounterValue where p.AccountID == personalAccountId select p).ToList(); return(counterValues); } }
public PersonalAccount GetPersonalAccount(int id) { using (var context = new CountersEntities()) { var personalAccount = (from p in context.PersonalAccount where p.AccountID == id select p).FirstOrDefault(); return(personalAccount); } }
public CounterOptions GetCounterOptions(int id) { using (var context = new CountersEntities()) { var productEntity = (from p in context.CounterOptions where p.CounterID == id select p).FirstOrDefault(); return(productEntity); } }
public void SetCounterValue(int personalAccountId, int counterId, float value) { using (var context = new CountersEntities()) { var counterValue = new CounterValue { CounterValudId = context.CounterValue.Count(), Unit = "Test", CounterID = counterId, CounterValue1 = (int)value, DateOfEnterValue = DateTime.UtcNow, AccountID = personalAccountId }; context.CounterValue.Add(counterValue); context.SaveChanges(); } }
public List <CounterValue> GetAllCounterValuesByTime(DateTime dateFrom, DateTime dateTo) { using (var context = new CountersEntities()) { List <CounterValue> counterValues = new List <CounterValue>(); foreach (CounterValue counterValue in context.CounterValue.ToList()) { if (counterValue.DateOfEnterValue >= dateFrom && counterValue.DateOfEnterValue <= dateTo) { counterValues.Add(counterValue); } } return(counterValues); } }
public List <CounterValue> GetAllCounterValuesByAccounts() { using (var context = new CountersEntities()) { return(context.CounterValue.ToList()); } }
public List <PersonalAccount> GetAllPersonalAccounts() { using (var context = new CountersEntities()) { return(context.PersonalAccount.ToList()); } }
public List <CounterOptions> GetAllCounterOptionses() { using (var context = new CountersEntities()) { return(context.CounterOptions.ToList()); } }