• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Business.SiteUser类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中mojoPortal.Business.SiteUser的典型用法代码示例。如果您正苦于以下问题:C# SiteUser类的具体用法?C# SiteUser怎么用?C# SiteUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SiteUser类属于mojoPortal.Business命名空间,在下文中一共展示了SiteUser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LoadSettings

        private void LoadSettings()
        {
            userId = WebUtils.ParseInt32FromQueryString("userId", -1);
            pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1);

            forumUser = new SiteUser(siteSettings, userId);
            if (forumUser.UserId == -1) { forumUser = null; }

            threadList.SiteSettings = siteSettings;
            threadList.ForumUser = forumUser;
            threadList.PageNumber = pageNumber;
            threadList.SiteRoot = SiteRoot;
            threadList.ImageSiteRoot = ImageSiteRoot;

            threadListAlt.SiteSettings = siteSettings;
            threadListAlt.ForumUser = forumUser;
            threadListAlt.PageNumber = pageNumber;
            threadListAlt.SiteRoot = SiteRoot;
            threadListAlt.ImageSiteRoot = ImageSiteRoot;

            if (displaySettings.UseAltUserThreadList)
            {
                threadList.Visible = false;
                threadListAlt.Visible = true;
            }

            AddClassToBody("forumuserthreads");
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:28,代码来源:UserThreads.aspx.cs


示例2: LoadSettings

        private void LoadSettings()
        {
            //spnAdmin.Visible = WebUser.IsAdminOrContentAdmin;

            currentUser = SiteUtils.GetCurrentSiteUser();
            letterInfoGuid = WebUtils.ParseGuidFromQueryString("l", Guid.Empty);

            if (letterInfoGuid == Guid.Empty) return;

            letterInfo = new LetterInfo(letterInfoGuid);
            if (letterInfo.SiteGuid != siteSettings.SiteGuid)
            {
                letterInfo = null;
                letterInfoGuid = Guid.Empty;

            }

            pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1);

            lnkAdminMenu.Visible = WebUser.IsAdminOrContentAdmin;
            litLinkSeparator1.Visible = lnkAdminMenu.Visible;

            AddClassToBody("administration");
            AddClassToBody("eletterdrafts");
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:25,代码来源:LetterDrafts.aspx.cs


示例3: HandleWindowsLiveConfirmation

        private void HandleWindowsLiveConfirmation(SiteUser siteUser)
        {
            if ((liveUser == null) || (windowsLive == null)) { return; }

            if (siteSettings.UseEmailForLogin)
            {
                FormsAuthentication.SetAuthCookie(
                    siteUser.Email, liveUser.UsePersistentCookie);
            }
            else
            {
                FormsAuthentication.SetAuthCookie(
                    siteUser.LoginName, liveUser.UsePersistentCookie);
            }

            if (WebConfigSettings.UseFoldersInsteadOfHostnamesForMultipleSites)
            {
                string cookieName = "siteguid" + siteSettings.SiteGuid;
                CookieHelper.SetCookie(cookieName, siteUser.UserGuid.ToString(), liveUser.UsePersistentCookie);
            }

            if (siteUser.UserId > -1 && siteSettings.AllowUserSkins && siteUser.Skin.Length > 0)
            {
                SiteUtils.SetSkinCookie(siteUser);
            }

            siteUser.UpdateLastLoginTime();

            //WebUtils.SetupRedirect(this, SiteRoot + "/Secure/UserProfile.aspx");
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:30,代码来源:ConfirmRegistration.aspx.cs


示例4: LoadSettings

        private void LoadSettings()
        {
            currentUser = SiteUtils.GetCurrentSiteUser();
            letterInfoGuid = WebUtils.ParseGuidFromQueryString("l", Guid.Empty);
            //spnAdmin.Visible = WebUser.IsAdminOrContentAdmin;
            ScriptConfig.IncludeColorBox = true;

            if (letterInfoGuid == Guid.Empty) return;

            letterInfo = new LetterInfo(letterInfoGuid);
            if (letterInfo.SiteGuid != siteSettings.SiteGuid)
            {
                letterInfo = null;
                letterInfoGuid = Guid.Empty;

            }

            pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1);
            timeOffset = SiteUtils.GetUserTimeOffset();
            timeZone = SiteUtils.GetUserTimeZone();

            lnkAdminMenu.Visible = WebUser.IsAdminOrContentAdmin;
            litLinkSeparator1.Visible = lnkAdminMenu.Visible;

            AddClassToBody("administration");
            AddClassToBody("eletterarchive");
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:27,代码来源:LetterArchive.aspx.cs


示例5: GetCountOfState

        public static int GetCountOfState(
            SiteSettings siteSettings,
            PersonalizationScope scope,
            PersonalizationStateQuery query)
        {
            int result = 0;

            if (siteSettings != null)
            {
                Guid userGuid = Guid.Empty;
                if ((query.UsernameToMatch != null) && (query.UsernameToMatch.Length > 0))
                {
                    SiteUser siteUser = new SiteUser(siteSettings, query.UsernameToMatch);
                    if (siteUser.UserId > 0)
                    {
                        userGuid = siteUser.UserGuid;
                    }

                }

                bool allUsersScope = (scope == PersonalizationScope.Shared);
                result = SitePersonalization.GetCountOfState(
                    siteSettings.SiteId,
                    query.PathToMatch,
                    allUsersScope,
                    userGuid,
                    query.UserInactiveSinceDate);

            }

            return result;
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:32,代码来源:PersonalizationHelper.cs


示例6: ClaimExistingSubscriptions

        /// <summary>
        /// people can subscribe to the newsletters without registering on the site. This method is used to attach those existing subscriptions to the user upon registration
        /// </summary>
        /// <param name="siteUser"></param>
        public static void ClaimExistingSubscriptions(SiteUser siteUser)
        {
            SubscriberRepository subscriptions = new SubscriberRepository();
            List<LetterSubscriber> userSubscriptions = subscriptions.GetListByEmail(siteUser.SiteGuid, siteUser.Email);

            foreach (LetterSubscriber s in userSubscriptions)
            {

                if (s.UserGuid != siteUser.UserGuid)
                {
                    s.UserGuid = siteUser.UserGuid;
                    subscriptions.Save(s);
                }

                if (!s.IsVerified)
                {
                    subscriptions.Verify(s.SubscribeGuid, true, Guid.Empty);
                    LetterInfo.UpdateSubscriberCount(s.LetterInfoGuid);

                }

            }

            List<LetterSubscriber> memberSubscriptions = subscriptions.GetListByUser(siteUser.SiteGuid, siteUser.UserGuid);

            RemoveDuplicates(memberSubscriptions);

            // commented out 2012-11-16 since we now give the user a chance to opt in the registration
            // then we should not force him in if he chose not to opt in

            //if (memberSubscriptions.Count == 0)
            //{
            //    string ipAddress = SiteUtils.GetIP4Address();
            //    //user has no previous subscriptions and just registered
            //    // lets give him the site subscriptions that are configured for opting in new users by default
            //    List<LetterInfo> allNewsletters = LetterInfo.GetAll(siteUser.SiteGuid);
            //    foreach (LetterInfo l in allNewsletters)
            //    {
            //        if ((l.ProfileOptIn) && (l.AvailableToRoles.Contains("All Users;")))
            //        {
            //            LetterSubscriber s = new LetterSubscriber();
            //            s.SiteGuid = siteUser.SiteGuid;
            //            s.LetterInfoGuid = l.LetterInfoGuid;
            //            s.UserGuid = siteUser.UserGuid;
            //            s.EmailAddress = siteUser.Email;
            //            s.IsVerified = true;
            //            s.UseHtml = true;
            //            s.IpAddress = ipAddress;
            //            subscriptions.Save(s);

            //        }

            //    }

            //}
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:60,代码来源:NewsletterHelper.cs


示例7: btnLockUser_Click

        protected void btnLockUser_Click(object sender, EventArgs e)
        {
            if (this.userID > -1)
            {
                SiteUser user = new SiteUser(siteSettings, this.userID);
                user.LockoutAccount();
            }

            WebUtils.SetupRedirect(this, Request.RawUrl);
            return;
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:11,代码来源:ManageUsers.aspx.cs


示例8: LoadSettings

        private void LoadSettings()
        {
            //avatarPath = Page.ResolveUrl("~/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/useravatars/");

            UntrustedContent2.TrustedImageUrlPattern = allowedImageUrlRegexPattern;

            allowView = WebUser.IsInRoles(siteSettings.RolesThatCanViewMemberList);
            userID = WebUtils.ParseInt32FromQueryString("userid", true, userID);
            timeOffset = SiteUtils.GetUserTimeOffset();
            timeZone = SiteUtils.GetUserTimeZone();
            userGuid = WebUtils.ParseGuidFromQueryString("u", Guid.Empty);

            if (userID > -1)
            {
                siteUser = new SiteUser(siteSettings, userID);
                if (siteUser.UserGuid == Guid.Empty) { siteUser = null; }
            }
            else if(userGuid != Guid.Empty)
            {
                siteUser = new SiteUser(siteSettings, userGuid);
                if (siteUser.UserGuid == Guid.Empty) { siteUser = null; }
            }

            switch (siteSettings.AvatarSystem)
            {
                case "gravatar":
                    allowGravatars = true;
                    disableAvatars = false;
                    break;

                case "internal":
                    allowGravatars = false;
                    disableAvatars = false;

                    break;

                case "none":
                default:
                    allowGravatars = false;
                    disableAvatars = true;
                    break;

            }

            if (displaySettings.OverrideAvatarLabel.Length > 0)
            {
                lblAvatar.ConfigKey = displaySettings.OverrideAvatarLabel;
            }

            if (displaySettings.HidePostCount) { divForumPosts.Visible = false; }

            AddClassToBody("profileview");
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:53,代码来源:ProfileView.aspx.cs


示例9: LoadPersonalizationBlobs

        public static void LoadPersonalizationBlobs(
            SiteSettings siteSettings,
            WebPartManager webPartManager,
            string path,
            string userName,
            ref byte[] sharedDataBlob,
            ref byte[] userDataBlob)
        {
            if (siteSettings != null)
            {
                if ((userName != null) && (userName.Length > 0))
                {
                    SiteUser siteUser = new SiteUser(siteSettings, userName);
                    Guid userID = Guid.Empty;
                    if (siteUser.UserId > 0)
                    {
                        userID = siteUser.UserGuid;
                    }

                    if (userID != Guid.Empty)
                    {
                        userDataBlob = SitePersonalization.GetPersonalizationBlob(
                            siteSettings.SiteId,
                            path,
                            userID);

                        siteUser.UpdateLastActivityTime();

                        sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
                            siteSettings.SiteId,
                            path);

                    }
                }
                else
                {
                    //TODO: tracking/personalization for unauthenticated users?

                    sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
                            siteSettings.SiteId,
                            path);

                }

            }
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:46,代码来源:PersonalizationHelper.cs


示例10: LoadSettings

        private void LoadSettings()
        {
            IsAdmin = WebUser.IsAdmin;
            isSiteEditor = SiteUtils.UserIsSiteEditor();
            isCommerceReportViewer = WebUser.IsInRoles(siteSettings.CommerceReportViewRoles);

            userGuid = WebUtils.ParseGuidFromQueryString("u", userGuid);

            customerUser = new SiteUser(siteSettings, userGuid);

            UserCommerceHistory commerceHistory = purchaseHx as UserCommerceHistory;

            commerceHistory.UserGuid = userGuid;
            commerceHistory.ShowAdminOrderLink = true;

            AddClassToBody("administration");
            AddClassToBody("commercereports");
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:18,代码来源:SalesCustomerDetail.aspx.cs


示例11: InstallContent

        public void InstallContent(Module module, string configInfo)
        {
            HtmlContent htmlContent = new HtmlContent();
            htmlContent.ModuleId = module.ModuleId;
            if (configInfo.StartsWith("~/"))
            {
                if (File.Exists(HostingEnvironment.MapPath(configInfo)))
                {
                    htmlContent.Body = File.ReadAllText(HostingEnvironment.MapPath(configInfo), Encoding.UTF8);
                }
            }
            else
            {
                htmlContent.Body = ResourceHelper.GetMessageTemplate(CultureInfo.CurrentUICulture, configInfo);
            }

            htmlContent.ModuleGuid = module.ModuleGuid;

            SiteSettings siteSettings = new SiteSettings(module.SiteId);
            SiteUser adminUser = null;
            if (siteSettings.UseEmailForLogin)
            {
                adminUser = new SiteUser(siteSettings, "[email protected]");
                if (adminUser.UserId == -1) { adminUser = null; }
            }
            else
            {
                adminUser = new SiteUser(siteSettings, "admin");
                if (adminUser.UserId == -1) { adminUser = null; }
            }

            if (adminUser != null)
            {
                htmlContent.UserGuid = adminUser.UserGuid;
                htmlContent.LastModUserGuid = adminUser.UserGuid;
            }

            HtmlRepository repository = new HtmlRepository();
            repository.Save(htmlContent);
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:40,代码来源:HtmlContentInstaller.cs


示例12: MojoPortalUser

 public MojoPortalUser()
 {
     try
     {
         if (HttpContext.Current.User.Identity.IsAuthenticated)
         {
             //UserInfo info = UserController.GetUserByName(((PortalSettings) HttpContext.Current.Items["PortalSettings"]).get_PortalId(), HttpContext.Current.User.Identity.Name, false);
             siteUser = SiteUtils.GetCurrentSiteUser();
             this.m_userID = siteUser.UserId;
             this.m_userName = siteUser.LoginName;
             this.m_email = siteUser.Email;
             this.m_firstName = siteUser.Name;
             this.m_lastName = "";
             this.m_location = siteUser.Country;
             this.m_isSuperAdmin = siteUser.IsInRoles("Administrators");
             this.m_isAuthenticated = true;
         }
     }
     catch (Exception exception)
     {
         throw new Exception("Failed to find user info from mojoPortal.", exception);
     }
 }
开发者ID:RH-Code,项目名称:YAFNET,代码行数:23,代码来源:MojoPortalUser.cs


示例13: LoadSettings

        private void LoadSettings()
        {
            currentUser = SiteUtils.GetCurrentSiteUser();
            config = new BlogConfiguration(ModuleSettings.GetModuleSettings(moduleId));

            lnkCategories.NavigateUrl = SiteRoot + "/Blog/EditCategory.aspx?pageid="
                + pageId.ToInvariantString() + "&mid=" + moduleId.ToInvariantString();

            lnkNewPost.NavigateUrl = SiteRoot + "/Blog/EditPost.aspx?pageid="
                + pageId.ToInvariantString() + "&mid=" + moduleId.ToInvariantString();

            lnkDrafts.NavigateUrl = SiteRoot + "/Blog/Drafts.aspx?pageid="
                + pageId.ToInvariantString() + "&mid=" + moduleId.ToInvariantString();

            lnkClosedPosts.NavigateUrl = SiteRoot + "/Blog/ClosedPosts.aspx?pageid="
                + pageId.ToInvariantString() + "&mid=" + moduleId.ToInvariantString();

            if (currentUser == null) { return; }

            if (BlogConfiguration.SecurePostsByUser)
            {
                if (WebUser.IsInRoles(config.ApproverRoles))
                {
                    countOfDrafts = Blog.GetCountOfDrafts(moduleId, Guid.Empty);
                }
                else
                {
                    countOfDrafts = Blog.GetCountOfDrafts(moduleId, currentUser.UserGuid);
                }
            }
            else
            {
                countOfDrafts = Blog.GetCountOfDrafts(moduleId, Guid.Empty);
            }

            countOfExpiredPosts = Blog.GetCountClosed(moduleId);
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:37,代码来源:Manage.aspx.cs


示例14: LoadSettings

        private void LoadSettings()
        {
            PageId = WebUtils.ParseInt32FromQueryString("pageid", -1);
            ModuleId = WebUtils.ParseInt32FromQueryString("mid", -1);
            payPalGetExpressCheckoutLogGuid = WebUtils.ParseGuidFromQueryString("plog", payPalGetExpressCheckoutLogGuid);

            if (payPalGetExpressCheckoutLogGuid == Guid.Empty)
            {
                Response.Redirect(SiteUtils.GetCurrentPageUrl());
            }

            checkoutDetailsLog = new PayPalLog(payPalGetExpressCheckoutLogGuid);

            if (checkoutDetailsLog.RowGuid == Guid.Empty)
            {
                Response.Redirect(SiteUtils.GetCurrentPageUrl());
            }

            cart = (Cart)SerializationHelper.DeserializeFromString(typeof(Cart), checkoutDetailsLog.SerializedObject);

            if (cart == null)
            {
                Response.Redirect(SiteUtils.GetCurrentPageUrl());
            }
            cart.DeSerializeCartOffers();

            cart.RefreshTotals();

            if ((cart.LastModified < DateTime.UtcNow.AddDays(-1)) && (cart.DiscountCodesCsv.Length > 0))
            {
                StoreHelper.EnsureValidDiscounts(store, cart);
            }

            siteUser = SiteUtils.GetCurrentSiteUser();
            //if (siteUser == null)
            //{
            //    Response.Redirect(SiteUtils.GetCurrentPageUrl());
            //}

            if ((siteUser != null)&&(cart.UserGuid == Guid.Empty))
            {
                // user wasn't logged in when express checkout was called
                cart.UserGuid = siteUser.UserGuid;
                cart.Save();
                //if (checkoutDetailsLog.UserGuid == Guid.Empty)
                //{
                //    // we need to make sure we have the user in the log and serialized cart
                //    checkoutDetailsLog.UserGuid = siteUser.UserGuid;
                //    cart.SerializeCartOffers();
                //    checkoutDetailsLog.SerializedObject = SerializationHelper.SerializeToSoap(cart);
                //    checkoutDetailsLog.Save();

                //}
            }

            if ((siteUser != null)&&(cart.UserGuid != siteUser.UserGuid))
            {
                Response.Redirect(SiteUtils.GetCurrentPageUrl());
            }

            if (ModuleId == -1)
            {
                ModuleId = StoreHelper.FindStoreModuleId(CurrentPage);
            }

            store = StoreHelper.GetStore();

            commerceConfig = SiteUtils.GetCommerceConfig();
            currencyCulture = ResourceHelper.GetCurrencyCulture(siteSettings.GetCurrency().Code);

            if (siteUser != null)
            {
                pnlRequireLogin.Visible = false;
            }
            else
            {
                btnMakePayment.Visible = false;
            }

            AddClassToBody("webstore webstoreexpresscheckout");
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:81,代码来源:PayPalExpressCheckout.aspx.cs


示例15: UserRoles_ItemCommand

        private void UserRoles_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            int roleID = Convert.ToInt32(userRoles.DataKeys[e.Item.ItemIndex]);
            SiteUser user = new SiteUser(siteSettings, userId);

            Role.RemoveUser(roleID, userId);
            userRoles.EditItemIndex = -1;
            if (user.UserId > -1)
            {
                user.RolesChanged = true;
                user.Save();
            }

            BindRoles();

            upRoles.Update();

            //WebUtils.SetupRedirect(this, Request.RawUrl);
            //return;
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:20,代码来源:UserRoles.ascx.cs


示例16: AddRole_Click

        private void AddRole_Click(Object sender, EventArgs e)
        {
            if ((userId > -1)&&(siteSettings != null))
            {
                SiteUser user = new SiteUser(siteSettings, userId);
                int roleID = int.Parse(allRoles.SelectedItem.Value, CultureInfo.InvariantCulture);
                Role role = new Role(roleID);
                Role.AddUser(roleID, userId, role.RoleGuid, user.UserGuid);
                user.RolesChanged = true;
                user.Save();

                BindRoles();

                upRoles.Update();

            }

            //WebUtils.SetupRedirect(this, Request.RawUrl);
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:19,代码来源:UserRoles.ascx.cs


示例17: TestCurrentUserLdap

 private bool TestCurrentUserLdap(LdapSettings testLdapSettings)
 {
     String uid = Context.User.Identity.Name;
     SiteUser user = new SiteUser(this.selectedSite, uid);
     return LdapHelper.TestUser(testLdapSettings, user.LoginName, txtLdapTestPassword.Text);
 }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:6,代码来源:SiteSettings.aspx.cs


示例18: InitializeOrderInfo

        //public static Cart GetCart(Guid storeGuid)
        //{
        //    if (HttpContext.Current != null)
        //    {
        //        string cartKey = "cart" + storeGuid.ToString();
        //        if (HttpContext.Current.Items[cartKey] != null)
        //        {
        //            return (Cart)HttpContext.Current.Items[cartKey];
        //        }
        //        else
        //        {
        //            if (UserHasCartCookie(storeGuid))
        //            {
        //                string cartCookie = GetCartCookie(storeGuid);
        //                if (cartCookie.Length == 36)
        //                {
        //                    Guid cartGuid = new Guid(cartCookie);
        //                    Cart cart = new Cart(cartGuid);
        //                    if (!cart.Exists)
        //                    {
        //                        return CreateCartAndSetCookie(storeGuid);
        //                    }
        //                    HttpContext.Current.Items[cartKey] = cart;
        //                    return cart;
        //                }
        //                else
        //                {
        //                    // cookie is invalid
        //                    return CreateCartAndSetCookie(storeGuid);
        //                }
        //            }
        //            else
        //            {
        //                // TODO: handle use case where user adds to cart on 1 machine
        //                // then comes back to site on another machine and has no cart cookie
        //                // look for a cart that has the userguid,
        //                // if found set cookie for that cart
        //                // new cart
        //                return CreateCartAndSetCookie(storeGuid);
        //            }
        //        }
        //    }
        //    return null;
        //}
        public static void InitializeOrderInfo(Cart cart, SiteUser siteUser)
        {
            if (cart.OrderInfo.CustomerLastName.Length == 0)
            {
                if(siteUser.LastName.Length > 0)
                {
                    cart.OrderInfo.CustomerLastName = siteUser.LastName;
                }
                else
                {
                    cart.OrderInfo.CustomerLastName = siteUser.Name;
                }
                cart.OrderInfo.CustomerFirstName = siteUser.FirstName;

            }
            cart.OrderInfo.CustomerTelephoneDay = siteUser.PhoneNumber;
            cart.OrderInfo.CustomerEmail = siteUser.Email;
            cart.OrderInfo.Save();
            cart.UserGuid = siteUser.UserGuid;
            cart.Save();
        }
开发者ID:joedavis01,项目名称:mojoportal,代码行数:65,代码来源:StoreHelper.cs


示例19: SendConfirmEmail

        private static void SendConfirmEmail(
            CultureInfo defaultCulture,
            CultureInfo currencyCulture,
            SiteSettings siteSettings,
            int pageId,
            CommerceConfiguration commerceConfig, 
            Store store, 
            Order order,
            string subjectTemplate,
            string textBodyTemplate)
        {
            if (store == null) { return; }
            if (order == null) { return; }
            if(siteSettings == null) { return; }

            if (!ShouldSendConfirmation(siteSettings.SiteId, order))
            {
                log.Info("confirmation email for order " + order.OrderGuid.ToString() + " not sent due to disabled by configuration");
                return;
            }

            //SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings();
            //CultureInfo currencyCulture = ResourceHelper.GetCurrencyCulture(siteSettings.GetCurrency().Code);

            //EmailMessageTask messageTask = new EmailMessageTask(SiteUtils.GetSmtpSettings());
            //messageTask.EmailFrom = store.SalesEmail;
            // TODO: implement from alias for store
            //messageTask.EmailFromAlias = siteSettings.DefaultFromEmailAlias;
            string email;
            if (order.CustomerEmail.Length > 0)
            {
                //messageTask.EmailTo = order.CustomerEmail;
                email = order.CustomerEmail;
            }
            else
            {
                SiteUser siteUser = new SiteUser(siteSettings, order.UserGuid);
                //messageTask.EmailTo = siteUser.Email;

                email = siteUser.Email;

            }

            //if (store.OrderBccEmail.Length > 0)
            //{
            //    messageTask.EmailBcc = store.OrderBccEmail;
            //}

            PageSettings page = new PageSettings(siteSettings.SiteId, pageId);

            string siteRoot = SiteUtils.GetNavigationSiteRoot();
            string storeLink = string.Empty;

            if (page.Url.StartsWith("~/"))
            {
                storeLink = siteRoot + page.Url.Replace("~/", "/");
            }
            else
            {
                storeLink = siteRoot;
            }

            string orderLink = siteRoot +
                "/WebStore/OrderDetail.aspx?pageid="
                + pageId.ToInvariantString()
                + "&mid=" + store.ModuleId.ToInvariantString()
                + "&orderid=" + order.OrderGuid.ToString();

            StringBuilder orderDetails = new StringBuilder();
            DataSet dsOffers = Order.GetOrderOffersAndProducts(store.Guid, order.OrderGuid);

            foreach (DataRow row in dsOffers.Tables["Offers"].Rows)
            {
                string og = row["OfferGuid"].ToString();
                orderDetails.Append(row["Name"].ToString() + " ");
                orderDetails.Append(row["Quantity"].ToString() + " @ ");
                orderDetails.Append(string.Format(currencyCulture, "{0:c}", Convert.ToDecimal(row["OfferPrice"])));
                orderDetails.Append("\r\n");

                string whereClause = string.Format("OfferGuid = '{0}'", og);
                DataView dv = new DataView(dsOffers.Tables["Products"], whereClause, "", DataViewRowState.CurrentRows);

                if (dv.Count > 1)
                {
                    foreach (DataRow r in dsOffers.Tables["Products"].Rows)
                    {
                        string pog = r["OfferGuid"].ToString();
                        if (og == pog)
                        {
                            orderDetails.Append(r["Name"].ToString() + " ");
                            orderDetails.Append(r["Quantity"].ToString() + "  \r\n");

                        }

                    }
                }

            }

            //messageTask.Subject = string.Format(
//.........这里部分代码省略.........
开发者ID:joedavis01,项目名称:mojoportal,代码行数:101,代码来源:StoreHelper.cs


示例20: LoadSettings

        private void LoadSettings()
        {
            siteSettings = CacheHelper.GetCurrentSiteSettings();
            TimeOffset = SiteUtils.GetUserTimeOffset();
            timeZone = SiteUtils.GetUserTimeZone();
            //pageNumber = WebUtils.ParseInt32FromQueryString("pagenumber", 1);

            notificationUrl = SiteRoot + "/Forums/EditSubscriptions.aspx?mid="
                + ModuleId.ToInvariantString()
                + "&pageid=" + PageId.ToInvariantString() +"#forum" + ItemId.ToInvariantString();

            lnkNotify.ImageUrl = ImageSiteRoot + "/Data/SiteImages/FeatureIcons/email.png";
            lnkNotify.NavigateUrl = notificationUrl;
            lnkNotify2.NavigateUrl = notificationUrl;

            if (WebConfigSettings.LoginPageRelativeUrl.Length > 0)
            {
                lnkLogin.NavigateUrl = SiteRoot + WebConfigSettings.LoginPageRelativeUrl + "?returnurl=" + Server.UrlEncode(Request.RawUrl);
            }
            else
            {
                lnkLogin.NavigateUrl = SiteRoot + "/Secure/Login.aspx?returnurl=" + Server.UrlEncode(Request.RawUrl);
            }

            if (Request.IsAuthenticated)
            {
                currentUser = SiteUtils.GetCurrentSiteUser();
                if ((currentUser != null) && (ItemId > -1))
                {
                    isSubscribedToForum = Forum.IsSubscribed(ItemId, currentUser.UserId);
                }

                if (!isSubscribedToForum) { pnlNotify.Visible = true; }

            }
        }
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:36,代码来源:ThreadList.ascx.cs



注:本文中的mojoPortal.Business.SiteUser类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Data.SqlParameterHelper类代码示例发布时间:2022-05-26
下一篇:
C# Business.SiteSettings类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap