Пример #1
0
		protected void BindCustomersList()
		{
			BPCustomers bpcat = new BPCustomers();
			DSCustomers = bpcat.SelectAll();
			DSCustomers.tbl_Customers.DefaultView.Sort = "CustomerLastName";
			dgCustomers.DataBind();
		}
Пример #2
0
		private void btnSend_ServerClick(object sender, EventArgs e)
		{
			if (txtFrom.Text == string.Empty)
			{
				lblErr.Visible = true;
				lblErr.Text = "Error: Please enter your email address.";
			}
			else
			{
				BECustomers ds = new BECustomers();
				BPCustomers bp = new BPCustomers();
				ds = bp.SelectByCustomerEmail(txtFrom.Text);
				if (ds.tbl_Customers.Count > 0)
				{
					BESetup setupInfo = new BESetup();
					BPSetup bpSetup = new BPSetup();
					setupInfo = bpSetup.SelectAll();

					SmtpMail.SmtpServer = setupInfo.tbl_Setup[0].SetupEmailServer;

					BECustomers.tbl_CustomersRow customer = ds.tbl_Customers[0];
					MailMessage mm = new MailMessage();
					mm.To = (txtFrom.Text.Replace(",", ";")).Trim();
					mm.From = setupInfo.tbl_Setup[0].SetupEmailAddress1;
					//mm.Subject = txtSubj.Text;
					mm.Subject = "Carrie'l Salon and Spa Administration";
					mm.Body += "Thank you for using Carrie'l Salon and Spa's Password Retrieval System.";
					mm.Body += "\r\n\r\nHere is your information:";
					mm.Body += "\r\n\r\nEmail:\t" + customer.CustomerEmail;
					mm.Body += "\r\nPassword:\t" + customer.CustomerPassword;
					mm.Body += "\r\n\r\nhttp://www.Carriel.ca";
					try
					{
						SmtpMail.Send(mm);
					}
					catch{}
					lblErr.Visible = true;
					lblErr.Text = "Your password has been sent.";

					pnlEmail.Visible = false;
					btnCont.Visible = true;
				}
				else
				{
					lblErr.Visible = true;
					lblErr.Text = "Error: Sorry, we could not find that email address.";
				}
			}
		}
Пример #3
0
		private void btnCreate_Click(object sender, EventArgs e)
		{
			string firstName = txtCreateFirstName.Text.Trim();
			string lastName = txtCreateLastName.Text.Trim();
			string email = txtCreateEmail.Text.Trim();
			string password = txtCreatePassword.Text.Trim();
			string passwordConfirm = txtCreateConfirm.Text.Trim();

//			if (txtCreatePassword.Text != txtCreateConfirm.Text)
//			{

			if(firstName == "" || lastName == "" || email == "" || password == "" || passwordConfirm == "")
			{
				lblLoginError.Visible = false;
				lblCreateError.Visible = true;
				lblCreateError.Text = "Error: First Name, Last Name, Email Address, Password, and Password Confirmation are all required.";
				return;
			}
			if (password != passwordConfirm)
			{
				lblLoginError.Visible = false;
				lblCreateError.Visible = true;
				lblCreateError.Text = "Error: Your password and password confirmation do not match.";
				return;
			}
			else
			{
				lblCreateError.Visible = false;
			}

//			if (Login(email, password))
//			{
//				Session["LoggedIn"] = true;
//				//ExtendSession = true;
//				if (CartID != 0)
//				{
//					ConvertTempCart(CartID,CustomerID);
//				}
//				Response.Redirect("CustomerInformation.aspx");
//			}

			BPCustomers bp = new BPCustomers();
			DSCustomers = bp.SelectByCustomerEmail(email);
			if(DSCustomers.tbl_Customers.Count > 0)
			{
				lblLoginError.Visible = false;
				lblCreateError.Visible = true;
				lblCreateError.Text = "Error: This Email Address is already in use.";
				return;
			}

			BECustomers.tbl_CustomersRow customer;
			DSCustomers = new BECustomers();

			if (CustomerID == 0)
			{
				// Add a Customer Category
				customer = DSCustomers.tbl_Customers.Newtbl_CustomersRow();
			}
			else
			{
				// Edit a Customer Category
				DSCustomers = bp.SelectCustomersByID(CustomerID);
				customer = DSCustomers.tbl_Customers.FindByCustomerID(CustomerID);				
			}
			//all content to be updated/inserted between here
			customer.CustomerFirstName = firstName;
			customer.CustomerLastName = lastName;
			customer.CustomerEmail = email;
			customer.CustomerPassword = password;
			//customer.CustomerNewsletter = chkCustomerNewsletter.Checked;
			customer.CustomerNewsletter = false;
			customer.CustomerActive = true;

			customer.DateModified = DateTime.Now;
			customer.ModifiedByAdminID = Convert.ToInt32(base.CustomerID);
						
			if (CustomerID == 0)
			{
				//Add new CustomerRow to table
				customer.DateCreated = DateTime.Now;

				DSCustomers.tbl_Customers.Addtbl_CustomersRow(customer);
			}

			bp.Update(DSCustomers);

			CustomerID = customer.CustomerID;

			AddAddress(0, firstName, lastName, email); //billing
			AddAddress(1, null, null, null); //shipping

			if (CartID != 0)
			{
				ConvertTempCart(CartID,CustomerID);
			}
			Response.Redirect("CustomerInformation.aspx");
		}
Пример #4
0
		private void btnDelete_Click(object sender, EventArgs e)
		{
			BPCustomers bp = new BPCustomers();

			//bp.DeleteCustomerCountriesByCustomerID(CustomerID);

			BECustomers.tbl_CustomersRow Customer;
			
			DSCustomers = bp.SelectCustomersByID(CustomerID);
			Customer = DSCustomers.tbl_Customers.FindByCustomerID(CustomerID);

			Customer.Delete();
			bp.Update(DSCustomers);

			Response.Redirect("BrowseCustomers.aspx");
		}
Пример #5
0
		private void btnSubmit_Click(object sender, EventArgs e)
		{
			BPCustomers bp = new BPCustomers();
			BECustomers.tbl_CustomersRow customer;
			DSCustomers = new BECustomers();

			if (CustomerID == 0)
			{
				// Add a Customer Category
				customer = DSCustomers.tbl_Customers.Newtbl_CustomersRow();
			}
			else
			{
				// Edit a Customer Category
				DSCustomers = bp.SelectCustomersByID(CustomerID);
				customer = DSCustomers.tbl_Customers.FindByCustomerID(CustomerID);				
			}
			//all content to be updated/inserted between here
			customer.CustomerFirstName = txtCustomerFirstName.Text;
			customer.CustomerLastName = txtCustomerLastName.Text;
			customer.CustomerEmail = txtCustomerEmail.Text;
			customer.CustomerPassword = txtCustomerPassword.Text;
			//customer.CustomerNewsletter = chkCustomerNewsletter.Checked;
			customer.CustomerNewsletter = false;
			customer.CustomerActive = chkCustomerActive.Checked;

			customer.DateModified = DateTime.Now;
			customer.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID);
			//all content to be updated/inserted between here			
			if (CustomerID == 0)
			{
				//Add new Customer Category
				customer.DateCreated = DateTime.Now;

				DSCustomers.tbl_Customers.Addtbl_CustomersRow(customer);
			}

			bp.Update(DSCustomers);

			_CustomerID = customer.CustomerID;

			UpdateAddress(BillingAddressID, 0);
			UpdateAddress(ShippingAddressID, 1);

			Response.Redirect("BrowseCustomers.aspx");
		}
Пример #6
0
		protected bool GetCustomerActiveStatus(int CustomerID)
		{
			BPCustomers bp = new BPCustomers();
			DSCustomers = bp.SelectCustomersByID(CustomerID);
			BECustomers.tbl_CustomersRow customer = DSCustomers.tbl_Customers[0];
			customer = DSCustomers.tbl_Customers[0];
			return customer.CustomerActive;
		}
Пример #7
0
		private void BindCustomers ()
		{
			BPCustomers bpCustomer = new BPCustomers();
			DSCustomers = bpCustomer.SelectAll();
			
			DSCustomers.tbl_Customers.DefaultView.Sort = "CustomerFullName";

			ddlCustomers.DataSource = DSCustomers.tbl_Customers.DefaultView;
			ddlCustomers.DataTextField = "CustomerFullName";
			ddlCustomers.DataValueField = "CustomerID";
			ddlCustomers.DataBind();

			ddlCustomers.Items.Insert(0, new ListItem("(All Customers)", "-1"));
		}