public async Task <AddNoteOutput> ExecuteAsync(AddNoteInput req) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pChangeBy ", DbType.String, Environment.UserName); db.AddInParameter(db.Command, "@pNote ", DbType.String, req.Note); db.AddInParameter(db.Command, "@pAccountIdentifier", DbType.Guid, req.AccountIdentifier); db.AddInParameter(db.Command, "@pCareAgentName", DbType.String, req.UserFullName); db.AddInParameter(db.Command, "@pCareAgentUserName", DbType.String, req.CareAgentUserName); db.AddParameter(db.Command, "@RETURN_VALUE", DbType.Int32, ParameterDirection.ReturnValue, string.Empty, DataRowVersion.Default, null); await db.ExecuteNonQueryAsync(); int noteKey; if (!int.TryParse(Convert.ToString(db.Command.Parameters["@RETURN_VALUE"].Value), out noteKey)) { throw new GdErrorException("Invalid NoteKey returned", new LogObject("AddNote_ExecuteAsync", new Dictionary <string, object> { { "CareAgentUserName", req.CareAgentUserName }, { "Note", req.Note } })); } return(new AddNoteOutput { Notekey = noteKey }); } }
public async Task <CallTransferOutput> ExecuteAsync(CallTransferInput input) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pPartnerCaseToken", DbType.String, input.PartnerCaseNo); db.AddInParameter(db.Command, "@pPartnerCallTypeKey", DbType.Int32, input.PartnerCallTypeKey); db.AddInParameter(db.Command, "@pSessionID", DbType.Guid, Guid.NewGuid()); db.AddInParameter(db.Command, "@pChangeBy", DbType.String, "Partner"); if (!string.IsNullOrEmpty(input.AccountIdentifier)) { db.AddInParameter(db.Command, "@pAccountIdentifier", DbType.Guid, new Guid(input.AccountIdentifier)); } db.AddParameter(db.Command, "@RETURN_VALUE", DbType.Int32, ParameterDirection.ReturnValue, string.Empty, DataRowVersion.Default, null); await db.ExecuteNonQueryAsync(); int qMasterKey; if (!int.TryParse(Convert.ToString(db.Command.Parameters["@RETURN_VALUE"].Value), out qMasterKey)) { throw new GdErrorException("Invalid QMasterKey returned", new LogObject("InsertQMaster_ExecuteAsync", new Dictionary <string, object> { { "PartnerCaseToken", input.PartnerCaseNo }, { "AccountIdentifier", input.AccountIdentifier }, { "PartnerCallTypeKey", input.PartnerCallTypeKey }, })); } return(new CallTransferOutput { QMasterKey = qMasterKey }); } }
public async Task <bool> ExecuteAsync(UpdateQMasterInput input) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pQMasterKey", DbType.Int32, input.QMasterKey); db.AddInParameter(db.Command, "@pCaseID", DbType.String, input.CaseID); db.AddInParameter(db.Command, "@pChangeBy", DbType.String, Environment.UserName); await db.ExecuteNonQueryAsync(new Dictionary <string, object> { { "QMasterKey", input.QMasterKey } }); return(true); } }
public async Task <List <GetNotesOutput> > ExecuteAsync(Guid input) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pAccountIdentifier", DbType.Guid, input); var getNotesOutput = new List <GetNotesOutput>(); var dr = await db.ExecuteReaderAsync(new Dictionary <string, object> { { "AccountIdentifier", input.ToString() } }); while (await dr.ReadAsync()) { getNotesOutput.Add(new GetNotesOutput() { Notekey = dr.GetValue <int>("NoteKey"), CareAgentName = dr.GetValue <string>("CareAgentName"), AccountIdentifier = dr.GetValue <Guid?>("AccountIdentifier").ToString(), Note = dr.GetValue <string>("Note"), ChangeBy = dr.GetValue <string>("ChangeBy"), CreateDate = dr.GetValue <DateTime>("CreateDate") }); } return(getNotesOutput); } }
private async Task <string> GetSalt(int clientAuthenticationPartnerKey, string userName) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pClientAuthenticationPartnerKey", DbType.Int32, clientAuthenticationPartnerKey); db.AddInParameter(db.Command, "@pUserName", DbType.String, userName); var dr = await db.ExecuteReaderAsync(new Dictionary <string, object> { { "ClientAuthenticationPartnerKey", clientAuthenticationPartnerKey } }); if (await dr.ReadAsync()) { var output = dr.GetValue <string>("Salt"); return(output); } return(string.Empty); } }
public async Task <int> GetClientAuthenticationKey(int clientAuthenticationPartnerKey, string userName, string hashPassword) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pClientAuthenticationPartnerKey", DbType.Int32, clientAuthenticationPartnerKey); db.AddInParameter(db.Command, "@pUserName", DbType.String, userName); db.AddInParameter(db.Command, "@pHashPassword", DbType.String, hashPassword); var dr = await db.ExecuteReaderAsync(new Dictionary <string, object> { { "ClientAuthenticationPartnerKey", clientAuthenticationPartnerKey } }); if (await dr.ReadAsync()) { var output = dr.GetValue <int>("ClientAuthenticationKey"); return(output); } return(0); } }
public async Task <GetPartnerAuthenticationOutput> ExecuteAsync(GetPartnerAuthenticationInput input) { using (var db = new SqlDatabaseEx("FwCrmEncryptSql", CommandText)) { db.AddInParameter(db.Command, "@pPartnerAuthenticationKey", DbType.Int32, input.PartnerAuthenticationKey); var output = new GetPartnerAuthenticationOutput(); var dr = await db.ExecuteReaderAsync(new Dictionary <string, object> { { "Input", input } }); if (await dr.ReadAsync()) { output.ConsumerKey = dr.GetValue <string>("ConsumerKey"); output.ConsumerSecret = dr.GetValue <string>("ConsumerSecret"); output.Domain = dr.GetValue <string>("Domain"); output.Login = dr.GetValue <string>("Login"); output.Password = dr.GetValue <string>("EncryptedPassword"); } return(output); } }
public async Task <QMasterInfoOutput> ExecuteAsync(GetQMasterByQMasterKeyInput input) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pQMasterKey", DbType.Int32, input.QMasterKey); var qMasterInfoOutput = new QMasterInfoOutput(); var dr = await db.ExecuteReaderAsync(new Dictionary <string, object> { { "QMasterKey", input.QMasterKey } }); if (await dr.ReadAsync()) { qMasterInfoOutput.PartnerCaseNo = dr.GetValue <string>("PartnerCaseToken"); qMasterInfoOutput.QMasterKey = dr.GetValue <int>("QMasterKey"); qMasterInfoOutput.AccountIdentifier = dr.GetValue <Guid?>("AccountIdentifier").ToString(); qMasterInfoOutput.PartnerCallTypeKey = dr.GetValue <int>("PartnerCallTypeKey"); qMasterInfoOutput.SessionID = dr.GetValue <Guid>("SessionID"); qMasterInfoOutput.CaseID = dr.GetValue <string>("CaseID"); return(qMasterInfoOutput); } return(null); } }
public async Task <QMasterInfoOutput> ExecuteAsync(GetQMasterbyPartnerCaseNoInput input) { using (var db = new SqlDatabaseEx(CommandText)) { db.AddInParameter(db.Command, "@pPartnerCaseToken", DbType.String, input.PartnerCaseNo); var dr = await db.ExecuteReaderAsync(new Dictionary <string, object> { { "PartnerCaseToken", input.PartnerCaseNo } }); if (await dr.ReadAsync()) { return(new QMasterInfoOutput() { PartnerCaseNo = dr.GetValue <string>("PartnerCaseToken"), QMasterKey = dr.GetValue <int>("QMasterKey"), AccountIdentifier = dr.GetValue <Guid?>("AccountIdentifier").ToString(), PartnerCallTypeKey = dr.GetValue <int>("PartnerCallTypeKey"), SessionID = dr.GetValue <Guid>("SessionID"), CaseID = dr.GetValue <string>("CaseID") }); } } return(null); }