Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.5 kB
6
Indexable
Never
public async Task<RentalApplicationModel> AddRentalApplication(string languageCode, RentalApplicationModel rentalApplicationModel, int subscriberId, int userId)
{  
if (rentalApplicationModel != null)
  {  
  var tenant = new Tenant();
  var tenantContact = new TenantContact();
  var tenantApplicationModel = rentalApplicationModel.TenantModel;

  tenant.FirstName = tenantApplicationModel.FirstName;
  tenant.MiddleName = tenantApplicationModel.MiddleName;
  tenant.LastName = tenantApplicationModel.LastName;
  tenant.Email = tenantApplicationModel.Email;
  
  
   tenant.DateCreated = DateTime.UtcNow;
   tenant.DateModified = DateTime.UtcNow;
   tenant.CreatedBy = userId;
   tenant.ModifiedBy = userId;
   tenant.SubscriberId = subscriberId;
   tenant.IsDeleted = false;

 var tenantContactModel = rentalApplicationModel.TenantContactModel;
 if (tenantContactModel != null)
 {
     
     tenantContact.TenantId = tenant.TenantId;
     tenantContact.HomePhone = tenantContactModel.HomePhone;
     tenantContact.MobilePhone = tenantContactModel.MobilePhone;
     tenantContact.Address1 = tenantContactModel.Address1;
     tenantContact.City = tenantContactModel.City;
     tenantContact.Country = tenantContactModel.Country;
     tenantContact.State = tenantContactModel.State;
     tenantContact.Zip = tenantContactModel.Zip;
     
     tenant.TenantContact = tenantContact;


}



 await _tenantRepository.CreateTenant(tenant);


}
return rentalApplicationModel;

}
Leave a Comment