Exemple #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="first_name"></param>
        /// <param name="last_name"></param>
        /// <param name="email_addr"></param>
        /// <param name="password"></param>
        /// <param name="addr1"></param>
        /// <param name="city"></param>
        /// <param name="postal_code"></param>
        /// <param name="state"></param>
        /// <param name="phone"></param>
        /// <param name="referredby"></param>
        /// <param name="paymentmethod"></param>
        /// <param name="cost"></param>
        public User CreateUser(
                       string first_name,
                       string last_name,
                       string email_addr,
                       string password,
                       string addr1,
                       string city,
                       string postal_code,
                       string state,
                       string phone,
                       string referredby,
                       string paymentmethod,
                       int cost
            )
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddUser";

            cmd.Parameters.AddWithValue("@FirstName", first_name);
            cmd.Parameters.AddWithValue("@LastName", last_name);
            cmd.Parameters.AddWithValue("@Email", email_addr);
            cmd.Parameters.AddWithValue("@Password", password);
            cmd.Parameters.AddWithValue("@Address", addr1);
            cmd.Parameters.AddWithValue("@city", city);
            cmd.Parameters.AddWithValue("@Zip", postal_code);
            cmd.Parameters.AddWithValue("@state", state);
            cmd.Parameters.AddWithValue("@phone", phone);
            cmd.Parameters.AddWithValue("@ReferredBy", referredby);
            cmd.Parameters.AddWithValue("@PaymentMethod", paymentmethod);
            cmd.Parameters.AddWithValue("@Cost", cost);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConectionString;
            dal.Connect();

            DataTable dt = dal.Execute(cmd);

            User user = new User
            {
                FirstName = first_name,
                LastName = last_name,
                Email = email_addr,
                Address = addr1,
                City = city,
                Zip = postal_code,
                State = state,
                Phone = phone,
                ReferredBy = referredby,
                PaymentMethod = paymentmethod,
                Cost = cost
            };

            return user;
        }
Exemple #2
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddCustomerSavedCreditCard";

            cmd.Parameters.AddWithValue("@CustomerNo", CustomerNo);
            cmd.Parameters.AddWithValue("@CreditCardType", CreditCardType);
            cmd.Parameters.AddWithValue("@CreditCardNumber", CreditCardNumber);
            cmd.Parameters.AddWithValue("@CreditCardExpDate", CreditCardExpDate);
            cmd.Parameters.AddWithValue("@PreferredCreditCard", PreferredCreditCard);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Exemple #3
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddProduct";

            cmd.Parameters.AddWithValue("@ProductNo", ProductNo);
            cmd.Parameters.AddWithValue("@ProductName", ProductName);
            cmd.Parameters.AddWithValue("@ProductSKU", ProductSKU);
            cmd.Parameters.AddWithValue("@ProductPrice", ProductPrice);
            cmd.Parameters.AddWithValue("@Weight", Weight);
            cmd.Parameters.AddWithValue("@Status", Status);
            cmd.Parameters.AddWithValue("@ShipFrom", ShipFrom);
            cmd.Parameters.AddWithValue("@Taxable", Taxable);
            cmd.Parameters.AddWithValue("@Visibility", Visibility);
            cmd.Parameters.AddWithValue("@DiscountEligible", DiscountEligible);
            cmd.Parameters.AddWithValue("@AllowDirectCheckout", AllowDirectCheckout);
            cmd.Parameters.AddWithValue("@AllowReviews", AllowReviews);
            cmd.Parameters.AddWithValue("@AllowQuestions", AllowQuestions);
            cmd.Parameters.AddWithValue("@StoreFrontURL", StoreFrontURL);
            cmd.Parameters.AddWithValue("@DirectCheckoutURL", DirectCheckoutURL);
            cmd.Parameters.AddWithValue("@ShortDescrption", ShortDescrption);
            cmd.Parameters.AddWithValue("@LongDescription", LongDescription);
            cmd.Parameters.AddWithValue("@DateCreated", DateCreated);
            cmd.Parameters.AddWithValue("@CreatedBy", CreatedBy);
            cmd.Parameters.AddWithValue("@DateLastUpdated", DateLastUpdated);
            cmd.Parameters.AddWithValue("@UpdatedBy", UpdatedBy);
            cmd.Parameters.AddWithValue("@ThumbNailImageURL", ThumbNailImageURL);
            cmd.Parameters.AddWithValue("@MainImageURL", MainImageURL);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Exemple #4
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddCustomer";

            cmd.Parameters.AddWithValue("@CustomerNo", CustomerNo);
            cmd.Parameters.AddWithValue("@Email", Email);
            cmd.Parameters.AddWithValue("@CustomerPassword", CustomerPassword);
            cmd.Parameters.AddWithValue("@CustomerPasswordReminder", CustomerPasswordReminder);
            cmd.Parameters.AddWithValue("@CustomerDiscount", CustomerDiscount);
            cmd.Parameters.AddWithValue("@CustomerType", CustomerType);
            cmd.Parameters.AddWithValue("@Active", Active);
            cmd.Parameters.AddWithValue("@MailingList", MailingList);
            cmd.Parameters.AddWithValue("@DateCreated", DateCreated);
            cmd.Parameters.AddWithValue("@LastUpdated", LastUpdated);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Exemple #5
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddOrderItem";

            cmd.Parameters.AddWithValue("@LineItemNo", LineItemNo);
            cmd.Parameters.AddWithValue("@OrderNo", OrderNo);
            cmd.Parameters.AddWithValue("@ProductNo", ProductNo);
            cmd.Parameters.AddWithValue("@ProductName", ProductName);
            cmd.Parameters.AddWithValue("@ProductSKU", ProductSKU);
            cmd.Parameters.AddWithValue("@ProductType", ProductType);
            cmd.Parameters.AddWithValue("@Quantity", Quantity);
            cmd.Parameters.AddWithValue("@UnitWeight", UnitWeight);
            cmd.Parameters.AddWithValue("@TotalWeight", TotalWeight);
            cmd.Parameters.AddWithValue("@LineStatus", LineStatus);
            cmd.Parameters.AddWithValue("@UnitPrice", UnitPrice);
            cmd.Parameters.AddWithValue("@ExtPrice", ExtPrice);
            cmd.Parameters.AddWithValue("@ShipDate", ShipDate);
            cmd.Parameters.AddWithValue("@TrackingNumber", TrackingNumber);
            cmd.Parameters.AddWithValue("@ProductKey", ProductKey);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Exemple #6
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddOrderAddress";

            cmd.Parameters.AddWithValue("@AddressType", AddressType);
            cmd.Parameters.AddWithValue("@AddressCategory", AddressCategory);
            cmd.Parameters.AddWithValue("@CustomerNo", CustomerNo);
            cmd.Parameters.AddWithValue("@FirstName", FistName);
            cmd.Parameters.AddWithValue("@LastName", LastName);
            cmd.Parameters.AddWithValue("@StreetAddress1", StreetAddress1);
            cmd.Parameters.AddWithValue("@City", City);
            cmd.Parameters.AddWithValue("@StateProvCode", StateProvCode);
            cmd.Parameters.AddWithValue("@ZipPostalCode", ZipPostalCode);
            cmd.Parameters.AddWithValue("@CountryCode", CountryCode);
            cmd.Parameters.AddWithValue("@PhoneNumber", PhoneNumber);
            cmd.Parameters.AddWithValue("@PrimaryShip", isPrimaryShip);
            cmd.Parameters.AddWithValue("@PrimaryBill", isPrimaryBill);
            cmd.Parameters.AddWithValue("@OrderNo", OrderNo);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Exemple #7
0
        public bool Save()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddOrder";

            cmd.Parameters.AddWithValue("@OrderNo", OrderNo);
            cmd.Parameters.AddWithValue("@OrderDate", OrderDate);
            cmd.Parameters.AddWithValue("@OrderType", OrderType);
            cmd.Parameters.AddWithValue("@OrderStatus", OrderStatus);
            cmd.Parameters.AddWithValue("@ShipDate", ShipDate);
            cmd.Parameters.AddWithValue("@BillingStatus", BillingStatus);
            cmd.Parameters.AddWithValue("@OrderAmount", OrderAmount);
            cmd.Parameters.AddWithValue("@OrderNet", OrderNet);
            cmd.Parameters.AddWithValue("@PlacedBy", PlacedBy);
            cmd.Parameters.AddWithValue("@LastUpdate", LastUpdate);
            cmd.Parameters.AddWithValue("@LastUpdateBy", LastUpdateBy);
            cmd.Parameters.AddWithValue("@IpAddress", IpAdress);
            cmd.Parameters.AddWithValue("@IpAddress_CountryCode", IpAdress_CountryCode);
            cmd.Parameters.AddWithValue("@CustomerNo", CustomerNo);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = Properties.Settings.Default.ConnectionString;
            dal.Connect();

            dal.Execute(cmd);

            return true;
        }
Exemple #8
0
        public bool Login(string email, string password)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "Login";

            cmd.Parameters.AddWithValue("@Email", email);
            cmd.Parameters.AddWithValue("@Password", password);

            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConectionString;
            dal.Connect();

            DataTable dt = dal.Execute(cmd);

            if (dt.Rows.Count > 0)
            {
                return true;
            }

            return false;
        }
Exemple #9
0
        public DataTable GetMediaGroupItem(string AssetID)
        {
            DataLayer dal = new DataLayer();
            dal.ConnectionString = ConectionString;
            dal.Connect();

            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "GetMediaGroupItem";
            cmd.Parameters.AddWithValue("@AssetID", AssetID);

            DataTable dt = dal.Execute(cmd);

            return dt;
        }