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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        public async Task <SortedList <int, PartnerCallTypeOutput> > ExecuteAsync()
        {
            using (var db = new SqlDatabaseEx(CommandText))
            {
                var output = new SortedList <int, PartnerCallTypeOutput>();
                var dr     = await db.ExecuteReaderAsync();

                while (await dr.ReadAsync())
                {
                    var partnerCallType = new PartnerCallTypeOutput
                    {
                        PartnerCallTypeKey         = dr.GetValue <int>("PartnerCallTypeKey"),
                        PartnerCallType            = dr.GetValue <string>("PartnerCallType"),
                        PartnerCallTypeDescription = dr.GetValue <string>("PartnerCallTypeDescription")
                    };
                    output.Add(partnerCallType.PartnerCallTypeKey, partnerCallType);
                }
                return(output);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
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);
        }