protected void btnGoFindOrder_Click(object sender, System.EventArgs e) { this.lblFindOrderMessage.Text = string.Empty; OrderSearchCriteria c = new OrderSearchCriteria(); c.OrderNumber = this.FindOrderNumberField.Text.Trim(); c.IsPlaced = true; c.StartDateUtc = DateTime.UtcNow.AddYears(-5); c.EndDateUtc = DateTime.UtcNow.AddYears(1); bool found = false; int totalCount = 0; List <OrderSnapshot> results = MTApp.OrderServices.Orders.FindByCriteriaPaged(c, 1, 10, ref totalCount); if (results != null) { if (results.Count > 0) { found = true; MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = MTApp.MembershipServices.Customers.Find(results[0].UserID); this.UserSelected(args); } } if (!found) { this.lblFindOrderMessage.Text = "<span class=\"errormessage\">That order was not found</span>"; } }
protected void GridView1_RowEditing(object sender, System.Web.UI.WebControls.GridViewEditEventArgs e) { string bvin = (string)GridView1.DataKeys[e.NewEditIndex].Value; CustomerAccount u = MTApp.MembershipServices.Customers.Find(bvin); MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = u; this.UserSelected(args); }
void UserPicker1_UserSelected(object sender, MerchantTribe.Commerce.Controls.UserSelectedEventArgs e) { Promotion p = GetCurrentPromotion(); UserIs q = (UserIs)GetCurrentQualification(p); if (q == null) { return; } q.AddUserId(e.UserAccount.Bvin); MyPage.MTApp.MarketingServices.Promotions.Update(p); LoadUserIsEditor(q); }
protected void UserSelected(MerchantTribe.Commerce.Controls.UserSelectedEventArgs args) { if (this.BvinField.Value == string.Empty) { Save(); } VendorManufacturer m = MTApp.ContactServices.Manufacturers.Find(this.BvinField.Value); if (m != null) { m.AddContact(args.UserAccount.Bvin); MTApp.ContactServices.Manufacturers.Update(m); } LoadGroups(m); }
protected void UserSelected(MerchantTribe.Commerce.Controls.UserSelectedEventArgs args) { if (args.UserAccount == null) { return; } this.UserIdField.Value = args.UserAccount.Bvin; o.UserID = args.UserAccount.Bvin; MTApp.OrderServices.Orders.Update(o); this.BillToAddress.LoadFromAddress(args.UserAccount.BillingAddress); this.ShipToAddress.LoadFromAddress(args.UserAccount.ShippingAddress); if (this.BillToAddress.FirstName == string.Empty) { this.BillToAddress.FirstName = args.UserAccount.FirstName; } if (this.BillToAddress.LastName == string.Empty) { this.BillToAddress.LastName = args.UserAccount.LastName; } if (this.ShipToAddress.FirstName == string.Empty) { this.ShipToAddress.FirstName = args.UserAccount.FirstName; } if (this.ShipToAddress.LastName == string.Empty) { this.ShipToAddress.LastName = args.UserAccount.LastName; } this.EmailAddressTextBox.Text = args.UserAccount.Email; ClearShipping(); o.UserEmail = this.EmailAddressTextBox.Text; o.BillingAddress = this.BillToAddress.GetAsAddress(); o.ShippingAddress = this.ShipToAddress.GetAsAddress(); MTApp.OrderServices.Orders.Update(o); }
protected void btnNewUserSave_Click(object sender, System.EventArgs e) { this.lblNewUserMessage.Text = string.Empty; CustomerAccount u = new CustomerAccount(); u.Email = this.NewUserEmailField.Text.Trim(); u.FirstName = this.NewUserFirstNameField.Text.Trim(); u.LastName = this.NewUserLastNameField.Text.Trim(); string clearPassword = MerchantTribe.Web.PasswordGenerator.GeneratePassword(12); if (MTApp.MembershipServices.CreateCustomer(u, clearPassword) == true) { MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = MTApp.MembershipServices.Customers.Find(u.Bvin); this.UserSelected(args); } else { this.lblNewUserMessage.Text = "<span class=\"errormessage\">Unable to create this account at this time. Unknown Error.</span>"; } }
protected void btnFindUser_Click(object sender, System.EventArgs e) { this.lblNewUserMessage.Text = string.Empty; this.GridView1.Visible = false; int totalCount = 0; bool found = false; List <CustomerAccount> users = MTApp.MembershipServices.Customers.FindByFilter(this.FilterUserField.Text.Trim(), 1, 10, ref totalCount); if (users != null) { if (users.Count > 0) { found = true; if (users.Count == 1) { this.lblFindUserMessage.Text = "<span class=\"successmessage\">User " + users[0].Email + " Found and Selected</span>"; MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = users[0]; this.UserSelected(args); } else { this.lblFindUserMessage.Text = "<span class=\"successmessage\">Found " + totalCount.ToString() + " matching users.</span>"; this.GridView1.Visible = true; this.GridView1.DataSource = users; this.GridView1.DataBind(); } } } if (!found) { this.lblFindUserMessage.Text = "<span class=\"errormessage\">No matching users were found.</span>"; } }
private void ValidateUser() { MerchantTribe.Commerce.Membership.CustomerAccount u = MyPage.MTApp.MembershipServices.Customers.FindByEmail(this.UserNameField.Text.Trim()); if (u != null) { if (u.Bvin != string.Empty) { MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = u; if (UserSelected != null) { UserSelected(this, args); } } else { if (MessageBox != null) { MessageBox.ShowWarning("User account " + this.UserNameField.Text.Trim() + " wasn't found. Please try again or create a new account."); } } } }
private void ValidateUser() { MerchantTribe.Commerce.Membership.CustomerAccount u = MyPage.MTApp.MembershipServices.Customers.FindByEmail(this.UserNameField.Text.Trim()); if (u != null) { if (u.Bvin != string.Empty) { MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = u; if (UserSelected != null) { UserSelected(this, args); } } else { if (MessageBox != null) MessageBox.ShowWarning("User account " + this.UserNameField.Text.Trim() + " wasn't found. Please try again or create a new account."); } } }
protected void btnNewUserSave_Click(object sender, System.EventArgs e) { this.lblNewUserMessage.Text = string.Empty; CustomerAccount u = new CustomerAccount(); u.Email = this.NewUserEmailField.Text.Trim(); u.FirstName = this.NewUserFirstNameField.Text.Trim(); u.LastName = this.NewUserLastNameField.Text.Trim(); string clearPassword = MerchantTribe.Web.PasswordGenerator.GeneratePassword(12); if (MTApp.MembershipServices.CreateCustomer(u, clearPassword) == true) { MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = MTApp.MembershipServices.Customers.Find(u.Bvin); this.UserSelected(args); } else { this.lblNewUserMessage.Text = "<span class=\"errormessage\">Unable to create this account at this time. Unknown Error.</span>"; } }
protected void btnGoFindOrder_Click(object sender, System.EventArgs e) { this.lblFindOrderMessage.Text = string.Empty; OrderSearchCriteria c = new OrderSearchCriteria(); c.OrderNumber = this.FindOrderNumberField.Text.Trim(); c.IsPlaced = true; c.StartDateUtc = DateTime.UtcNow.AddYears(-5); c.EndDateUtc = DateTime.UtcNow.AddYears(1); bool found = false; int totalCount = 0; List<OrderSnapshot> results = MTApp.OrderServices.Orders.FindByCriteriaPaged(c, 1, 10, ref totalCount); if (results != null) { if (results.Count > 0) { found = true; MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = MTApp.MembershipServices.Customers.Find(results[0].UserID); this.UserSelected(args); } } if (!found) { this.lblFindOrderMessage.Text = "<span class=\"errormessage\">That order was not found</span>"; } }
protected void GridView1_RowEditing(object sender, System.Web.UI.WebControls.GridViewEditEventArgs e) { string bvin = (string)GridView1.DataKeys[e.NewEditIndex].Value; CustomerAccount u = MTApp.MembershipServices.Customers.Find(bvin); MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = u; this.UserSelected(args); }
protected void btnFindUser_Click(object sender, System.EventArgs e) { this.lblNewUserMessage.Text = string.Empty; this.GridView1.Visible = false; int totalCount = 0; bool found = false; List<CustomerAccount> users = MTApp.MembershipServices.Customers.FindByFilter(this.FilterUserField.Text.Trim(), 1, 10, ref totalCount); if (users != null) { if (users.Count > 0) { found = true; if (users.Count == 1) { this.lblFindUserMessage.Text = "<span class=\"successmessage\">User " + users[0].Email + " Found and Selected</span>"; MerchantTribe.Commerce.Controls.UserSelectedEventArgs args = new MerchantTribe.Commerce.Controls.UserSelectedEventArgs(); args.UserAccount = users[0]; this.UserSelected(args); } else { this.lblFindUserMessage.Text = "<span class=\"successmessage\">Found " + totalCount.ToString() + " matching users.</span>"; this.GridView1.Visible = true; this.GridView1.DataSource = users; this.GridView1.DataBind(); } } } if (!found) { this.lblFindUserMessage.Text = "<span class=\"errormessage\">No matching users were found.</span>"; } }
void UserPicker1_UserSelected(MerchantTribe.Commerce.Controls.UserSelectedEventArgs e) { this.UserIdField.Value = e.UserAccount.Bvin; }