public bool SaveDetails(CustomerDto newDetails) { this.customer = newDetails.DtoToEntity(); if (this._customer.Insert(this.customer).IsNull()) { return(false); } return(true); }
public bool UpdateDetails(CustomerDto newDetails) { //var oldDetails = FindById(newDetails.CustomerId); var details = newDetails.DtoToEntity(); if (_customer.Update2(details).IsNull()) { return(false); } return(true); }
public bool Update(CustomerDto customerDto) { try { _context.Customer.Update(customerDto.DtoToEntity()); _context.SaveChanges(); return(true); } catch { return(false); } }
public bool Delete(CustomerDto customerDto) { try { if (customerDto != null) { _context.Customer.Remove(customerDto.DtoToEntity()); _context.SaveChanges(); return(true); } return(false); } catch { return(false); } }