public void SetAccountInfo([FromBody] SetAccountInfo accountInfo)
        {
            //TODO: use transactions here and in any other multi-call endpoints
            var deletedRecords = DBFacilitator.GetInteger(
                PostgreSQLConnectionString,
                DELETE_ACCOUNT,
                new List <Tuple <string, string, NpgsqlDbType> >()
            {
                { new Tuple <string, string, NpgsqlDbType>(":UniqueId", accountInfo.UniqueId.ToString(), NpgsqlDbType.Integer) }
            });

            DBFacilitator.ExecuteCommand(
                PostgreSQLConnectionString,
                INSERT_ACCOUNT,
                new List <Tuple <string, string, NpgsqlDbType> >()
            {
                { new Tuple <string, string, NpgsqlDbType>(":UniqueId", accountInfo.UniqueId.ToString(), NpgsqlDbType.Integer) },
                { new Tuple <string, string, NpgsqlDbType>(":Email", accountInfo.AddressInfo.Email, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":FirstName", accountInfo.AddressInfo.FirstName, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":LastName", accountInfo.AddressInfo.LastName, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":Address1", accountInfo.AddressInfo.Address1, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":Address2", accountInfo.AddressInfo.Address2, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":City", accountInfo.AddressInfo.City, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":State", accountInfo.AddressInfo.State, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":Zip", accountInfo.AddressInfo.Zip, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":Country", accountInfo.AddressInfo.Country, NpgsqlDbType.Text) },
                { new Tuple <string, string, NpgsqlDbType>(":Phone", accountInfo.AddressInfo.Phone, NpgsqlDbType.Text) }
            });
        }
示例#2
0
        public Client(string key)
        {
            var requester = new Requester(key);

            CreateAuthUri          = new CreateAuthUri(requester);
            GetOobConfirmationCode = new GetOobConfirmationCode(requester);
            ResetPassword          = new ResetPassword(requester);
            SetAccountInfo         = new SetAccountInfo(requester);
            SignupNewUser          = new SignupNewUser(requester);
            VerifyPassword         = new VerifyPassword(requester);
        }
 public void SetAccountInfo(SetAccountInfo accountInfo)
 {
     dal.SetAccountInfo(accountInfo.UniqueId, accountInfo.AddressInfo);
 }
        public void SetAccountInfo(int uniqueID, AddressInfo addressInfo)
        {
            var getUniqueId = new SetAccountInfo(uniqueID, addressInfo);

            Utility.ServiceCall(requestURL + "/setaccountinfo", JsonConvert.SerializeObject(getUniqueId));
        }