public bool CreateClient(Client client) { bool status = false; try { DataAccessLayer.Models.Client newClient = client.JsonToEntity(); status = repo.CreateClient(newClient); } catch (Exception) { throw; return(false); } return(status); }
public bool UpdateClient(Client client) { bool status = false; try { DataAccessLayer.Models.Client updatedClient = client.JsonToEntity(); status = repo.UpdateClient(updatedClient); } catch (Exception) { return(false); } return(status); }
public DataAccessLayer.Models.Client JsonToEntity() { DataAccessLayer.Models.Client newClient = new DataAccessLayer.Models.Client { FirstName = this.FirstName, MiddleName = this.MiddleName, LastName = this.LastName, DateOfBirth = this.DateOfBirth, AssetValue = this.AssetValue, HomePhoneNumber = this.HomePhoneNumber, OfficePhoneNumber = this.OfficePhoneNumber, Email = this.Email, DriversLicenseIdNum = this.DriversLicenseIdNum, AccountStatusId = this.AccountStatusId, UserId = this.UserId }; return(newClient); }