/// <summary> /// Insert /// </summary> public async Task <bool> Insert(SubcontractProfile.WebApi.Services.Model.SubcontractProfilePersonal subcontractProfilePersonal) { var p = new DynamicParameters(); p.Add("@personal_id", subcontractProfilePersonal.PersonalId); p.Add("@citizen_id", subcontractProfilePersonal.CitizenId); p.Add("@title_name", subcontractProfilePersonal.TitleName); p.Add("@full_name_en", subcontractProfilePersonal.FullNameEn); p.Add("@full_name_th", subcontractProfilePersonal.FullNameTh); p.Add("@birth_date", subcontractProfilePersonal.BirthDate); p.Add("@gender", subcontractProfilePersonal.Gender); p.Add("@race", subcontractProfilePersonal.Race); p.Add("@nationality", subcontractProfilePersonal.Nationality); p.Add("@religion", subcontractProfilePersonal.Religion); p.Add("@passport_attach_file", subcontractProfilePersonal.PassportAttachFile); p.Add("@identity_by", subcontractProfilePersonal.IdentityBy); p.Add("@address_id", subcontractProfilePersonal.AddressId); p.Add("@identity_card_address", subcontractProfilePersonal.IdentityCardAddress); p.Add("@contact_phone1", subcontractProfilePersonal.ContactPhone1); p.Add("@contact_phone2", subcontractProfilePersonal.ContactPhone2); p.Add("@contact_email", subcontractProfilePersonal.ContactEmail); p.Add("@work_permit_no", subcontractProfilePersonal.WorkPermitNo); p.Add("@work_permit_attach_file", subcontractProfilePersonal.WorkPermitAttachFile); p.Add("@profile_img_attach_file", subcontractProfilePersonal.ProfileImgAttachFile); p.Add("@education", subcontractProfilePersonal.Education); p.Add("@th_listening", subcontractProfilePersonal.ThListening); p.Add("@th_speaking", subcontractProfilePersonal.ThSpeaking); p.Add("@th_reading", subcontractProfilePersonal.ThReading); p.Add("@th_writing", subcontractProfilePersonal.ThWriting); p.Add("@en_listening", subcontractProfilePersonal.EnListening); p.Add("@en_speaking", subcontractProfilePersonal.EnSpeaking); p.Add("@en_reading", subcontractProfilePersonal.EnReading); p.Add("@en_writing", subcontractProfilePersonal.EnWriting); p.Add("@certificate_type", subcontractProfilePersonal.CertificateType); p.Add("@certificate_no", subcontractProfilePersonal.CertificateNo); p.Add("@certificate_expire_date", subcontractProfilePersonal.CertificateExpireDate); p.Add("@certificate_attach_file", subcontractProfilePersonal.CertificateAttachFile); p.Add("@bank_code", subcontractProfilePersonal.BankCode); p.Add("@bank_name", subcontractProfilePersonal.BankName); p.Add("@account_number", subcontractProfilePersonal.AccountNumber); p.Add("@account_name", subcontractProfilePersonal.AccountName); p.Add("@status", subcontractProfilePersonal.Status); p.Add("@create_date", subcontractProfilePersonal.CreateDate); p.Add("@create_by", subcontractProfilePersonal.CreateBy); p.Add("@update_by", subcontractProfilePersonal.UpdateBy); p.Add("@update_date", subcontractProfilePersonal.UpdateDate); var ok = await _dbContext.Connection.ExecuteAsync ("uspSubcontractProfilePersonal_Insert", p, commandType : CommandType.StoredProcedure, transaction : _dbContext.Transaction); return(true); }
public Task <bool> Update(SubcontractProfile.WebApi.Services.Model.SubcontractProfilePersonal subcontractProfilePersonal) { _logger.LogInformation($"Start PersonalController::Update", subcontractProfilePersonal); if (subcontractProfilePersonal == null) { _logger.LogWarning($"Start PersonalController::Update", subcontractProfilePersonal); } var result = _service.Update(subcontractProfilePersonal); if (result == null) { _logger.LogWarning($"PersonalController::", "Update NOT FOUND", subcontractProfilePersonal); } return(result); }