Ejemplo n.º 1
0
 public static CustomerPointAccount CreateCustomerPointAccount(int customerID, int pointAccountID, decimal pointBalance)
 {
     CustomerPointAccount customerPointAccount = new CustomerPointAccount();
     customerPointAccount.CustomerID = customerID;
     customerPointAccount.PointAccountID = pointAccountID;
     customerPointAccount.PointBalance = pointBalance;
     return customerPointAccount;
 }
Ejemplo n.º 2
0
 public void AddToCustomerPointAccounts(CustomerPointAccount customerPointAccount)
 {
     base.AddObject("CustomerPointAccounts", customerPointAccount);
 }
Ejemplo n.º 3
0
        public CustomerPointAccount GetCustomerPointAccount(int CustomerID, int PointAccountID)
        {
            var result = new CustomerPointAccount();

            using (var reader = GetContext().GetReader(@"
                    SELECT
                        PointAccountID,
                        CustomerID,
                        PointBalance
                    FROM CustomerPointAccounts
                    WHERE
                        CustomerID = {0}
                        AND PointAccountID = {1}
                ", CustomerID, PointAccountID))
            {
                if (!reader.Read()) return null;

                result.CustomerID = reader.GetInt32("CustomerID");
                result.PointAccountID = reader.GetInt32("PointAccountID");
                result.Balance = reader.GetDecimal("PointBalance");
            }

            return result;
        }
Ejemplo n.º 4
0
        public CustomerPointAccount GetCustomerPointAccount(int CustomerID, int PointAccountID)
        {
            var result = new CustomerPointAccount();

            var response = GetContext().GetPointAccount(new GetPointAccountRequest()
            {
                CustomerID = CustomerID,
                PointAccountID = PointAccountID
            });
            if(response == null) return null;

            result.CustomerID = CustomerID;
            result.PointAccountID = PointAccountID;
            result.Balance = response.Balance;

            return result;
        }
Ejemplo n.º 5
0
        public CustomerPointAccount GetCustomerPointAccount(int CustomerID, int PointAccountID)
        {
            var result = new CustomerPointAccount();

            var response = GetContext().CustomerPointAccounts
                .Where(c => c.CustomerID == CustomerID)
                .Where(c => c.PointAccountID == PointAccountID)
                .FirstOrDefault();
            if(response == null) return null;

            result.CustomerID = CustomerID;
            result.PointAccountID = PointAccountID;
            result.Balance = response.PointBalance;

            return result;
        }