Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }