void BindgvwOrders() { try { PurchaseHistory1.CurrentAspNetId = CurrentUserProfile.MembershipID; PurchaseHistory1.Bind(); //List<hcc> orders = hcc_Order.GetBy(this.PrimaryKeyIndex); //gvwOrders.DataSource = orders; //gvwOrders.DataBind(); } catch { throw; } }
void BindHistory() { PurchaseHistory1.CurrentAspNetId = CurrentAspNetId.Value; //PurchaseHistory1.PrimaryKeyIndex = selectCartId; PurchaseHistory1.Bind(); }
protected override void LoadForm() { try { MembershipUser user = Helpers.LoggedUser; //form fields if (user != null) { CurrentUserProfile = hccUserProfile.GetParentProfileBy((Guid)user.ProviderUserKey); if (Roles.IsUserInRole("Customer")) { if (CurrentUserProfile == null) { CurrentUserProfile = new hccUserProfile { AccountBalance = 0.0m, CreatedBy = (Guid)user.ProviderUserKey, CreatedDate = DateTime.Now, IsActive = true, MembershipID = (Guid)user.ProviderUserKey, ModifiedBy = (Guid)user.ProviderUserKey, ModifiedDate = DateTime.Now }; CurrentUserProfile.Save(); } if (CurrentUserProfile != null) { this.PrimaryKeyIndex = CurrentUserProfile.UserProfileID; //Basic Info BasicEdit1.PrimaryKeyIndex = this.PrimaryKeyIndex; BasicEdit1.Bind(); //shipping address if (CurrentUserProfile.ShippingAddressID.HasValue) { AddressEdit_Shipping1.PrimaryKeyIndex = CurrentUserProfile.ShippingAddressID.Value; AddressEdit_Shipping1.Bind(); } ProfileNotesEdit_Shipping.CurrentUserProfileId = CurrentUserProfile.UserProfileID; ProfileNotesEdit_Shipping.Bind(); //billing address BillingInfoEdit1.PrimaryKeyIndex = CurrentUserProfile.UserProfileID; BillingInfoEdit1.CurrentBillingAddressID = CurrentUserProfile.BillingAddressID; BillingInfoEdit1.Bind(); ProfileNotesEdit_Billing.CurrentUserProfileId = CurrentUserProfile.UserProfileID; ProfileNotesEdit_Billing.Bind(); ProfilePrefsEdit1.PrimaryKeyIndex = CurrentUserProfile.UserProfileID; ProfilePrefsEdit1.Bind(); ProfileAllgsEdit1.PrimaryKeyIndex = CurrentUserProfile.UserProfileID; ProfileAllgsEdit1.Bind(); //subprofiles BindgvwSubProfiles(); SubProfileEdit1.CurrentParentAspNetId = (Guid)user.ProviderUserKey; SubProfileEdit1.CurrentParentProfileId = CurrentUserProfile.UserProfileID; //order history PurchaseHistory1.CurrentAspNetId = (Guid)user.ProviderUserKey; PurchaseHistory1.Bind(); //Recurring Orders UserProfileRecurringOrders.CurrentAspNetId = (Guid)user.ProviderUserKey; UserProfileRecurringOrders.Bind(); } } else { //This Account exists but doesn't have the Customer Role //pnl_js_noncustomer.Visible = true; li_link_01.Visible = false; panel1.Visible = false; li_link_02.Visible = false; panel2.Visible = false; li_link_03.Visible = false; panel3.Visible = false; li_link_04.Visible = false; panel4.Visible = false; li_link_05.Visible = false; panel5.Visible = false; li_link_06.Visible = false; panel6.Visible = false; li_link_07.Visible = false; panel7.Visible = false; li_link_09.Visible = false; panel9.Visible = false; if (CurrentUserProfile != null) { CurrentUserProfile.Activation(false); } } } else { FormsAuthentication.RedirectToLoginPage(); } } catch (Exception) { throw; } }