public List <CourseDTO> GetAll() { try { return(MapDTO.MapList <CourseDTO, Course>(_uow.CourseRepo.GetAll())); } catch (Exception e) { log.Error("kon niet ophalen", e); throw new Exception(e.Message); } }
public List <ProductDTO> GetAll() { try { return(MapDTO.MapList <ProductDTO, Product>(_uow.ProductRepo.GetAll())); } catch (Exception e) { log.Error("kon geen producten oplijsten"); throw new Exception(e.Message); } }
public List <VatDTO> GetAll() { try { return(MapDTO.MapList <VatDTO, Vat>(_uow.VatRepo.GetAll())); } catch (Exception e) { log.Error("kon geen btw's vinden", e); throw new Exception(e.Message); } }
public List <InvoiceDetailDTO> GetAll() { try { return(MapDTO.MapList <InvoiceDetailDTO, InvoiceDetail>(_uow.InvoiceDetailRepo.GetAll())); } catch (Exception e) { log.Error("kon geen facturen ophalen", e); throw new Exception(e.Message); } }
public void Delete(ProductDTO c) { try { _uow.ProductRepo.Remove(MapDTO.Map <Product, ProductDTO>(c)); _uow.Save(); } catch (Exception e) { log.Error("kon geen product verwijderen"); throw new Exception(e.Message); } }
public ProductPriceDTO FindByID(int?id) { try { var c = _uow.ProductPriceRepo.FindById(id); return(c == null ? null : MapDTO.Map <ProductPriceDTO, ProductPrice>(c)); } catch (Exception e) { log.Error("kon geen Prijs id vinden"); throw new Exception(e.Message); } }
public void Delete(InvoiceDetailDTO c) { try { _uow.InvoiceDetailRepo.Remove(MapDTO.Map <InvoiceDetail, InvoiceDetailDTO>(c)); _uow.Save(); } catch (Exception e) { log.Error("kon geen factuur verwijderen", e); throw new Exception(e.Message); } }
public VatDTO FindByID(int?id) { try { var c = _uow.VatRepo.FindById(id); return(c == null ? null : MapDTO.Map <VatDTO, Vat>(c)); } catch (Exception e) { log.Error("kon geen btw id vinden", e); throw new Exception(e.Message); } }
public void Delete(VatDTO c) { try { _uow.VatRepo.Remove(MapDTO.Map <Vat, VatDTO>(c)); _uow.Save(); } catch (Exception e) { log.Error("kon geen btw verwijderen", e); throw new Exception(e.Message); } }
public void Delete(CourseDTO c) { try { _uow.CourseRepo.Remove(MapDTO.Map <Course, CourseDTO>(c)); _uow.Save(); } catch (Exception e) { log.Error("kon geen cursus verwijderren", e); throw new Exception(e.Message); } }
public CourseDTO FindByID(int?id) { try { var c = _uow.CourseRepo.FindById(id); return(c == null ? null : MapDTO.Map <CourseDTO, Course>(c)); } catch (Exception e) { log.Error("Kon id niet vinden", e); throw new Exception(e.Message); } }
public InvoiceDetailDTO FindByID(int?id) { try { var c = _uow.InvoiceDetailRepo.FindById(id); return(c == null ? null : MapDTO.Map <InvoiceDetailDTO, InvoiceDetail>(c)); } catch (Exception e) { log.Error("kon geen id van factuur vinden", e); throw new Exception(e.Message); } }
public InvoiceDetailDTO Update(InvoiceDetailDTO c) { try { _uow.InvoiceDetailRepo.Modify(MapDTO.Map <InvoiceDetail, InvoiceDetailDTO>(c)); _uow.Save(); return(c); } catch (Exception e) { log.Error("kon geen factuur aanpassen", e); throw new Exception(e.Message); } }
public InvoiceDTO Update(InvoiceDTO c) { try { _uow.InvoiceRepo.Modify(MapDTO.Map <Invoice, InvoiceDTO>(c)); _uow.Save(); return(c); } catch (Exception e) { log.Error("kon niet updaten"); throw new Exception(e.Message); } }
public ProductDTO Update(ProductDTO c) { try { _uow.ProductRepo.Modify(MapDTO.Map <Product, ProductDTO>(c)); _uow.Save(); return(c); } catch (Exception e) { log.Error("kon geen product wijzigen"); throw new Exception(e.Message); } }
public CourseDTO Update(CourseDTO c) { try { _uow.CourseRepo.Modify(MapDTO.Map <Course, CourseDTO>(c)); _uow.Save(); return(c); } catch (Exception e) { log.Error("kon niet updaten"); throw new Exception(e.Message); } }
public VatDTO Update(VatDTO c) { try { _uow.VatRepo.Modify(MapDTO.Map <Vat, VatDTO>(c)); _uow.Save(); return(c); } catch (Exception e) { log.Error("kon geen btw aanpassen", e); throw new Exception(e.Message); } }
public ProductPriceDTO Update(ProductPriceDTO c) { try { _uow.ProductPriceRepo.Modify(MapDTO.Map <ProductPrice, ProductPriceDTO>(c)); _uow.Save(); return(c); } catch (Exception e) { log.Error("kon geen prijs aanpassen", e); throw new Exception(e.Message); } }
public void Delete(int id) { var c = FindByID(id); try { _uow.ProductRepo.Remove(MapDTO.Map <Product, ProductDTO>(c)); _uow.Save(); } catch (Exception e) { log.Error("kon geen product verwijderren", e); throw new Exception(e.Message); } }
public void Delete(int id) { var c = FindByID(id); try { _uow.InvoiceRepo.Remove(MapDTO.Map <Invoice, InvoiceDTO>(c)); _uow.Save(); } catch (Exception e) { log.Error("kon geen invoice verwijderren", e); throw new Exception(e.Message); } }
public VatDTO Create(VatDTO c) { try { var vat = MapDTO.Map <Vat, VatDTO>(c); _uow.VatRepo.Add(vat); _uow.Save(); c.Id = vat.Id; return(c); } catch (Exception e) { log.Error(e.Message); throw new Exception(e.Message); } }
public CourseDTO Create(CourseDTO c) { try { var course = MapDTO.Map <Course, CourseDTO>(c); _uow.CourseRepo.Add(course); _uow.Save(); c.Id = course.Id; return(c); } catch (Exception e) { log.Error("Kon geen cursus aanmaken", e); throw new Exception(e.Message); } }
public ProductPriceDTO Create(ProductPriceDTO c) { try { var productPrice = MapDTO.Map <ProductPrice, ProductPriceDTO>(c); _uow.ProductPriceRepo.Add(productPrice); _uow.Save(); c.Id = productPrice.Id; return(c); } catch (Exception e) { log.Error("kon geen productprijs toevoegen"); throw new Exception(e.Message); } }
public InvoiceDetailDTO Create(InvoiceDetailDTO c) { try { var invoiceDetail = MapDTO.Map <InvoiceDetail, InvoiceDetailDTO>(c); InvoiceDTO invoice = _invoiceLogic.GetAll().Last(); invoiceDetail.InvoiceId = invoice.Id; _uow.InvoiceDetailRepo.Add(invoiceDetail); _uow.Save(); c.Id = invoiceDetail.Id; return(c); } catch (Exception e) { log.Error("kon geen factuur toeveogen"); throw new Exception(e.Message); } }
public ProductDTO Create(ProductDTO c) { try { var product = MapDTO.Map <Product, ProductDTO>(c); ProductPriceDTO price = _prdPriceLogic.GetAll().Last(); product.PriceId = price.Id; _uow.ProductRepo.Add(product); _uow.Save(); c.Id = product.Id; return(c); } catch (Exception e) { log.Error("kon geen product toevoegen", e); throw new Exception(e.Message); } }
public InvoiceDTO Create(InvoiceDTO c) { try { if (today != firstDayOfNextMonth) { counter++; var now = DateTime.Now; var generateId = now.Year + "-" + now.Month + "-" + counter; var invoiceRepo = MapDTO.Map <Invoice, InvoiceDTO>(c); invoiceRepo.InvoiceCode = generateId; _uow.InvoiceRepo.Add(invoiceRepo); _uow.Save(); c.Id = invoiceRepo.Id; } else { getCounter(); var now = DateTime.Now; var generateId = now.Year + "-" + now.Month + "-" + counter; var invoiceRepo = MapDTO.Map <Invoice, InvoiceDTO>(c); invoiceRepo.InvoiceCode = generateId; _uow.InvoiceRepo.Add(invoiceRepo); _uow.Save(); c.InvoiceCode = generateId; c.Id = invoiceRepo.Id; } return(c); } catch (Exception e) { log.Error("kon geen factuur toevoegen", e); throw new Exception(e.Message); } }
public void Delete(InvoiceDTO c) { _uow.InvoiceRepo.Remove(MapDTO.Map <Invoice, InvoiceDTO>(c)); _uow.Save(); }
public List <InvoiceDTO> GetAll() { return(MapDTO.MapList <InvoiceDTO, Invoice>(_uow.InvoiceRepo.GetAll())); }
public InvoiceDTO FindByID(int?id) { var c = _uow.InvoiceRepo.FindById(id); return(c == null ? null : MapDTO.Map <InvoiceDTO, Invoice>(c)); }