using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using Microsoft.Data.SqlClient; using PayRollDAL.DTO.Address; using PayRollDAL.Query.Contact; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PayRollDAL.CustomeCode.Contact { public class ContactDAL : IContactDAL { private readonly IQueryExecutor _QueryExecutor; public ContactDAL(IQueryExecutor QueryExecutor) { _QueryExecutor = QueryExecutor; } public async Task SaveContact(ContactDTO contactDTO, LoginDTO loginDTO) { try { string sql = ContactQB.SAVE_CONTACT; return await _QueryExecutor.ExecuteAsync(loginDTO, sql, contactDTO); } catch (Exception ex) { throw new Exception("Error while saving contact", ex); } } public async Task UpdateContact(ContactDTO contactDTO, LoginDTO loginDTO) { try { string sql = ContactQB.UPDATE_CONTACT; return await _QueryExecutor.ExecuteAsync(loginDTO, sql, contactDTO); } catch (Exception ex) { throw new Exception("Error while updating contact", ex); } } } }