Пример #1
0
        internal void SaveAddresses(Address billing, Address shipping)
        {
            this.billingID = billing.ID;
            this.shippingID = shipping.ID;

            Customer tmp = new Customer();
            EcommercePlatformDataContext db = new EcommercePlatformDataContext();
            tmp = db.Customers.Where(x => x.ID.Equals(this.ID)).FirstOrDefault<Customer>();
            tmp.billingID = this.billingID;
            tmp.shippingID = this.shippingID;
            db.SubmitChanges();
        }
		private void attach_Customers1(Customer entity)
		{
			this.SendPropertyChanging();
			entity.Address1 = this;
		}
Пример #3
0
        internal void Save()
        {
            EcommercePlatformDataContext db = new EcommercePlatformDataContext();
            PasswordGenerator pw = new PasswordGenerator();
                string new_pass = pw.Generate();

            // Make sure we don't have an account with this e-mail address
            Customer cust = this.GetCustomerByEmail();
            if (cust != null && cust.ID > 0) {
                throw new Exception("An account using the E-Mail address you provided already exists.");
            }

            // We are going to make an attempt at saving the Customer record

            Customer new_customer = new Customer {
                email = this.email,
                fname = this.fname,
                lname = this.lname,
                phone = this.phone,
                dateAdded = this.dateAdded,
                isSuspended = this.isSuspended,
                isValidated = this.isValidated,
                validator = this.validator,
                password = this.password,
                receiveNewsletter = this.receiveNewsletter,
                receiveOffers = this.receiveOffers,
            };

            db.Customers.InsertOnSubmit(new_customer);
            db.SubmitChanges();
            this.ID = new_customer.ID;

            SendNotification();
        }
		private void detach_Customers(Customer entity)
		{
			this.SendPropertyChanging();
			entity.Address = null;
		}
 partial void DeleteCustomer(Customer instance);
 partial void UpdateCustomer(Customer instance);
 partial void InsertCustomer(Customer instance);
Пример #8
0
 internal void UpdatePassword() {
     Customer tmp = new Customer();
     EcommercePlatformDataContext db = new EcommercePlatformDataContext();
     tmp = db.Customers.Where(x => x.ID.Equals(this.ID)).FirstOrDefault<Customer>();
     tmp.password = this.password;
     db.SubmitChanges();
 }