public List<Transaction> GetTransactions(User customer, Company company, DateTime beginningDate, DateTime endingDate)
        {
            var transactions = _databaseModel.Transactions
                .Where(t => (beginningDate <= t.CreatetedAt) && (t.CreatetedAt <= endingDate))
                .OrderByDescending(t => t.CreatetedAt);

            if (customer != null)
            {
                var filteredTransactions = transactions.Where(t => t.UserId.Equals(customer.UserId));
                return filteredTransactions.ToList();
            }
            if (company != null)
            {
               // var storesList = _databaseModel.Stores.Where(s => s.CompanyId.Equals(company.CompanyId));
               // var filteredTransactions = transactions.Join(storesList, t => t.StoreId, s => s.StoreId,
                                                            // (o, id) => o);
                var filteredTransactions = transactions.Where(t => t.CompanyId.Equals(company.CompanyId));
                return filteredTransactions.ToList();
            }
            return transactions.ToList();
        }
 private void AddCompany(Company company)
 {
     company.CreatetedAt = DateTime.Now;
     company.UpdatedAt = DateTime.Now;
     _companiesRepository.AddCompany(company);
 }
 public void Save(Company company)
 {
     if (company.CompanyId == 0)
     {
         AddCompany(company);
     }
     else
     {
         EditCompany(company);
     }
 }
        private void EditCompany(Company company)
        {
            //TODO: Check porqué esta dando problemas
            company.CreatetedAt = DateTime.Now;

            company.UpdatedAt = DateTime.Now;
            _companiesRepository.EditCompany(company);
        }
 public void EditCompany(Company company)
 {
     _databaseModel.Entry(company).State = EntityState.Modified;
     _databaseModel.SaveChanges();
 }
 public void AddCompany(Company company)
 {
     _databaseModel.Companies.Add(company);
     _databaseModel.SaveChanges();
 }
 public List<Transaction> GetTransactions(Company company, DateTime beginningDate, DateTime endingDate)
 {
     return _transactionsRepository.GetTransactions(null, company, beginningDate, endingDate);
 }