Exemple #1
0
 public InvoiceRepository()
 {
     _context = new InvoiceDBContext();
 }
Exemple #2
0
 public InvoiceRepository(InvoiceDBContext context)
 {
     context = _context;
 }
        /*
         * private readonly ApiTestContext _context;
         * public SalesInvoiceRepository(ApiTestContext context)
         * {
         *  _context = context;
         * }
         *
         * public IEnumerable<SalesInvoice> GetSalesInvoices()
         * {
         *  var salesInvoices = _context.SalesInvoice.Where(si => si.Deleted == Constants.ROW_NOT_DELETED).AsEnumerable();
         *
         *  return salesInvoices;
         * }
         *
         * public async Task<SalesInvoice> GetSalesInvoiceById(int id)
         * {
         *  var salesInvoice = await _context.SalesInvoice.FirstOrDefaultAsync(si => si.id == id && si.Deleted == Constants.ROW_NOT_DELETED);
         *
         *  return salesInvoice;
         * }
         *
         * public async Task InsertSalesInvoice(SalesInvoice salesInvoice)
         * {
         *  _context.SalesInvoice.Add(salesInvoice);
         *  await _context.SaveChangesAsync();
         * }
         *
         * public async void UpdateSalesInvoice(SalesInvoice salesInvoice)
         * {
         *  var currentSaleInvoice = await GetSalesInvoiceById(salesInvoice.id);
         *  currentSaleInvoice.IdCustomer = salesInvoice.IdCustomer;
         *  currentSaleInvoice.DateSales = salesInvoice.DateSales;
         *  currentSaleInvoice.Address = salesInvoice.Address;
         *  currentSaleInvoice.Country = salesInvoice.Country;
         *  currentSaleInvoice.City = salesInvoice.City;
         *  currentSaleInvoice.Discount = salesInvoice.Discount;
         *  currentSaleInvoice.Total = salesInvoice.Total;
         *  currentSaleInvoice.TotalWithoutDiscount = salesInvoice.TotalWithoutDiscount;
         *  currentSaleInvoice.Status = salesInvoice.Status;
         *  currentSaleInvoice.CreateDate = currentSaleInvoice.CreateDate;
         *  currentSaleInvoice.UpdateDate = DateTime.Now;
         *  await _context.SaveChangesAsync();
         *
         * }
         *
         * public async Task<bool> DeleteSalesInvoice(int id)
         * {
         *  var currentSaleInvoice = await GetSalesInvoiceById(id);
         *  currentSaleInvoice.Deleted = Constants.ROW_DELETED;
         *  int rows = await _context.SaveChangesAsync();
         *  return rows > 0;
         *
         * }*/

        public SalesInvoiceRepository(InvoiceDBContext context) : base(context)
        {
        }
Exemple #4
0
 /// <summary>
 /// 
 /// </summary>
 public UserService()
 {
     _dbContext = new InvoiceDBContext();
 }
Exemple #5
0
 public UnitofWork(InvoiceDBContext context)
 {
     _context = context;
     Invoice  = new InvoiceRepository(_context);
 }
 public CompanyRepository(InvoiceDBContext context)
 {
     context = _context;
 }
 public CompanyRepository()
 {
     _context = new InvoiceDBContext();
 }
Exemple #8
0
 public UnitOfWork(InvoiceDBContext context)
 {
     _context = context;
 }
Exemple #9
0
 public Repository(InvoiceDBContext context)
 {
     _context  = context;
     _entities = context.Set <T>();
 }