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

C# Core.ExtendedUserData类代码示例

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

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



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

示例1: btnSave_Click

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (pageContents != null) {
                pageContents.TitleBar = txtTitle.Text;
                pageContents.NavMenuText = txtNav.Text;
                pageContents.PageHead = txtHead.Text;

                pageContents.MetaDescription = txtDescription.Text;
                pageContents.MetaKeyword = txtKey.Text;
                pageContents.Thumbnail = txtThumb.Text;

                pageContents.EditDate = SiteData.CurrentSite.Now;

                pageContents.GoLiveDate = ucReleaseDate.GetDate();
                pageContents.RetireDate = ucRetireDate.GetDate();

                pageContents.PageActive = chkActive.Checked;
                pageContents.ShowInSiteNav = chkNavigation.Checked;
                pageContents.ShowInSiteMap = chkSiteMap.Checked;
                pageContents.BlockIndex = chkHide.Checked;

                if (String.IsNullOrEmpty(hdnCreditUserID.Value)) {
                    pageContents.CreditUserId = null;
                } else {
                    var usr = new ExtendedUserData(hdnCreditUserID.Value);
                    pageContents.CreditUserId = usr.UserId;
                }

                cmsHelper.cmsAdminContent = pageContents;

                Master.ShowSave();

                Response.Redirect(SiteData.CurrentScriptName + "?pageid=" + pageContents.Root_ContentID.ToString() + Master.SavedSuffix);
            }
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:35,代码来源:PageEdit.aspx.cs


示例2: FindUser

		private Guid FindUser(Guid userId) {
			ExtendedUserData usr = new ExtendedUserData(userId);

			if (usr == null) {
				return SecurityData.CurrentUserGuid;
			} else {
				return userId;
			}
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:9,代码来源:SiteImportNativeModel.cs


示例3: SiteExportUser

		public SiteExportUser(ExtendedUserData user) {
			if (user != null) {
				this.ExportUserID = user.UserId;
				this.Email = user.Email;
				this.Login = user.UserName;
				this.FirstName = user.FirstName;
				this.LastName = user.LastName;
				this.UserNickname = user.UserNickName;
			}
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:10,代码来源:SiteExportUser.cs


示例4: btnAddUsers_Click

		protected void btnAddUsers_Click(object sender, EventArgs e) {
			if (!String.IsNullOrEmpty(hdnUserID.Value)) {
				MembershipRole role = getCurrentGroup();

				ExtendedUserData exUsr = new ExtendedUserData(hdnUserID.Value);
				exUsr.AddToRole(role.RoleName);
			}

			Response.Redirect(SiteData.CurrentScriptName + "?id=" + groupID.ToString());
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:10,代码来源:UserGroupAddEdit.aspx.cs


示例5: btnAddUsers_Click

		protected void btnAddUsers_Click(object sender, EventArgs e) {
			if (!String.IsNullOrEmpty(hdnUserID.Value)) {
				ExtendedUserData exUsr = new ExtendedUserData(hdnUserID.Value);
				exUsr.AddToSite(guidSiteID);

				if (chkAddToEditor.Checked) {
					exUsr.AddToRole(SecurityData.CMSGroup_Editors);
				}
			}

			Response.Redirect(SiteData.CurrentScriptName + "?id=" + guidSiteID.ToString());
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:12,代码来源:SiteDetail.aspx.cs


示例6: OnPreRender

		protected override void OnPreRender(EventArgs e) {
			if (usr == null) {
				usr = ExtendedUserData.GetEditorFromURL();
			}
			if (usr == null) {
				ContentPage cp = cu.GetContainerContentPage(this);
				usr = cp.GetUserInfo();
			}

			AssignUser();

			base.OnPreRender(e);
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:13,代码来源:AuthorData.cs


示例7: btnSave_Click

        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (pageContents != null) {
                pageContents.TitleBar = txtTitle.Text;
                pageContents.NavMenuText = txtNav.Text;
                pageContents.PageHead = txtHead.Text;

                pageContents.MetaDescription = txtDescription.Text;
                pageContents.MetaKeyword = txtKey.Text;
                pageContents.Thumbnail = txtThumb.Text;

                pageContents.EditDate = SiteData.CurrentSite.Now;

                pageContents.GoLiveDate = Convert.ToDateTime(txtReleaseDate.Text + " " + txtReleaseTime.Text);
                pageContents.RetireDate = Convert.ToDateTime(txtRetireDate.Text + " " + txtRetireTime.Text);

                pageContents.PageActive = chkActive.Checked;
                pageContents.ShowInSiteNav = false;
                pageContents.ShowInSiteMap = false;
                pageContents.BlockIndex = chkHide.Checked;

                List<ContentCategory> lstCat = new List<ContentCategory>();
                List<ContentTag> lstTag = new List<ContentTag>();

                lstCat = (from cr in CollectCheckboxRepeater(rpCat)
                          join l in SiteData.CurrentSite.GetCategoryList() on cr equals l.ContentCategoryID
                          select l).ToList();

                lstTag = (from cr in CollectCheckboxRepeater(rpTag)
                          join l in SiteData.CurrentSite.GetTagList() on cr equals l.ContentTagID
                          select l).ToList();

                pageContents.ContentCategories = lstCat;
                pageContents.ContentTags = lstTag;

                if (string.IsNullOrEmpty(hdnCreditUserID.Value)) {
                    pageContents.CreditUserId = null;
                } else {
                    var usr = new ExtendedUserData(hdnCreditUserID.Value);
                    pageContents.CreditUserId = usr.UserId;
                }

                pageContents.FileName = ContentPageHelper.CreateFileNameFromSlug(pageContents.SiteID, pageContents.GoLiveDate, pageContents.PageSlug);

                cmsHelper.cmsAdminContent = pageContents;

                Master.ShowSave();

                Response.Redirect(SiteData.CurrentScriptName + "?pageid=" + pageContents.Root_ContentID.ToString() + Master.SavedSuffix);
            }
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:51,代码来源:BlogPostEdit.aspx.cs


示例8: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Master.ActivateTab(AdminBaseMasterPage.SectionID.UserFn);

            divInfoMsg.Visible = false;
            InfoMessage.Text = "";

            if (!IsPostBack) {
                txtEmail.Text = SecurityData.CurrentUser.Email;
                ExtendedUserData exUsr = new ExtendedUserData(SecurityData.CurrentUser.UserName);
                txtNickName.Text = exUsr.UserNickName;
                txtFirstName.Text = exUsr.FirstName;
                txtLastName.Text = exUsr.LastName;
                reBody.Text = exUsr.UserBio;
            }
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:16,代码来源:UserProfile.aspx.cs


示例9: btnSaveEmail_Click

        protected void btnSaveEmail_Click(object sender, EventArgs e)
        {
            MembershipUser usr = SecurityData.CurrentUser;
            usr.Email = txtEmail.Text;
            Membership.UpdateUser(usr);

            ExtendedUserData exUsr = new ExtendedUserData(SecurityData.CurrentUser.UserName);
            exUsr.UserNickName = txtNickName.Text;
            exUsr.FirstName = txtFirstName.Text;
            exUsr.LastName = txtLastName.Text;
            exUsr.UserBio = reBody.Text;

            exUsr.Save();

            divInfoMsg.Visible = true;
            InfoMessage.Text = "Profile Updated";
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:17,代码来源:UserProfile.aspx.cs


示例10: Page_Load

		protected void Page_Load(object sender, EventArgs e) {
			Master.UsesSaved = true;
			Master.HideSave();

			guidContentID = GetGuidPageIDFromQuery();

			cmsHelper.OverrideKey(guidContentID);

			if (cmsHelper.cmsAdminContent != null) {
				pageContents = cmsHelper.cmsAdminContent;
				litPageName.Text = pageContents.FileName;

				if (!IsPostBack) {
					GeneralUtilities.BindList(listCats, SiteData.CurrentSite.GetCategoryList().OrderBy(x => x.CategoryText));
					GeneralUtilities.BindList(listTags, SiteData.CurrentSite.GetTagList().OrderBy(x => x.TagText));

					txtTitle.Text = pageContents.TitleBar;
					txtNav.Text = pageContents.NavMenuText;
					txtHead.Text = pageContents.PageHead;
					txtThumb.Text = pageContents.Thumbnail;

					txtDescription.Text = pageContents.MetaDescription;
					txtKey.Text = pageContents.MetaKeyword;

					txtReleaseDate.Text = pageContents.GoLiveDate.ToShortDateString();
					txtReleaseTime.Text = pageContents.GoLiveDate.ToShortTimeString();
					txtRetireDate.Text = pageContents.RetireDate.ToShortDateString();
					txtRetireTime.Text = pageContents.RetireDate.ToShortTimeString();

					lblUpdated.Text = pageContents.EditDate.ToString();

					chkActive.Checked = pageContents.PageActive;
					chkHide.Checked = pageContents.BlockIndex;

					if (pageContents.CreditUserId.HasValue) {
						var usr = new ExtendedUserData(pageContents.CreditUserId.Value);
						hdnCreditUserID.Value = usr.UserName;
						txtSearchUser.Text = string.Format("{0} ({1})", usr.UserName, usr.EmailAddress);
					}

					GeneralUtilities.SelectListValues(listTags, pageContents.ContentTags.Cast<IContentMetaInfo>().Select(x => x.ContentMetaInfoID.ToString()).ToList());
					GeneralUtilities.SelectListValues(listCats, pageContents.ContentCategories.Cast<IContentMetaInfo>().Select(x => x.ContentMetaInfoID.ToString()).ToList());
				}
			}
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:45,代码来源:BlogPostEdit.aspx.cs


示例11: Page_Load

		protected void Page_Load(object sender, EventArgs e) {
			Master.UsesSaved = true;
			Master.HideSave();

			guidContentID = GetGuidPageIDFromQuery();

			cmsHelper.OverrideKey(guidContentID);

			if (cmsHelper.cmsAdminContent != null) {
				pageContents = cmsHelper.cmsAdminContent;
				litPageName.Text = pageContents.FileName;

				if (!IsPostBack) {
					txtTitle.Text = pageContents.TitleBar;
					txtNav.Text = pageContents.NavMenuText;
					txtHead.Text = pageContents.PageHead;
					txtThumb.Text = pageContents.Thumbnail;

					txtDescription.Text = pageContents.MetaDescription;
					txtKey.Text = pageContents.MetaKeyword;

					txtReleaseDate.Text = pageContents.GoLiveDate.ToShortDateString();
					txtReleaseTime.Text = pageContents.GoLiveDate.ToShortTimeString();
					txtRetireDate.Text = pageContents.RetireDate.ToShortDateString();
					txtRetireTime.Text = pageContents.RetireDate.ToShortTimeString();

					lblUpdated.Text = pageContents.EditDate.ToString();

					chkActive.Checked = pageContents.PageActive;
					chkNavigation.Checked = pageContents.ShowInSiteNav;
					chkSiteMap.Checked = pageContents.ShowInSiteMap;
					chkHide.Checked = pageContents.BlockIndex;

					if (pageContents.CreditUserId.HasValue) {
						var usr = new ExtendedUserData(pageContents.CreditUserId.Value);
						hdnCreditUserID.Value = usr.UserName;
						txtSearchUser.Text = string.Format("{0} ({1})", usr.UserName, usr.EmailAddress);
					}
				}
			}
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:41,代码来源:PageEdit.aspx.cs


示例12: btnRemove_Click

		protected void btnRemove_Click(object sender, EventArgs e) {
			CheckBox chkSelected = null;
			HiddenField hdnUserId = null;

			foreach (GridViewRow dgItem in gvUsers.Rows) {
				hdnUserId = (HiddenField)dgItem.FindControl("hdnUserId");

				if (hdnUserId != null) {
					chkSelected = (CheckBox)dgItem.FindControl("chkSelected");

					Guid guidUsrID = new Guid(hdnUserId.Value);
					ExtendedUserData exUsr = new ExtendedUserData(guidUsrID);

					if (chkSelected.Checked) {
						exUsr.RemoveFromSite(guidSiteID);
					}
				}
			}

			Response.Redirect(SiteData.CurrentScriptName + "?id=" + guidSiteID.ToString());
		}
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:21,代码来源:SiteDetail.aspx.cs


示例13: UserEdit

		public ActionResult UserEdit(UserModel model) {
			ExtendedUserData userExt = model.User;

			if (ModelState.IsValid) {
				var user = securityHelper.UserManager.FindByName(model.User.UserName);

				IdentityResult result = securityHelper.UserManager.SetEmail(userExt.UserKey, userExt.Email);
				result = securityHelper.UserManager.SetPhoneNumber(userExt.UserKey, userExt.PhoneNumber);

				if (userExt.LockoutEndDateUtc.HasValue) {
					//DateTime utcDateTime = DateTime.SpecifyKind(userExt.LockoutEndDateUtc.Value, DateTimeKind.Utc);
					//DateTimeOffset utcOffset = utcDateTime;
					//result = manage.UserManager.SetLockoutEnabled(userExt.UserKey, true);
					//result = manage.UserManager.SetLockoutEndDate(userExt.UserKey, utcOffset);
					if (!user.LockoutEndDateUtc.HasValue) {
						// set lockout
						user.LockoutEndDateUtc = userExt.LockoutEndDateUtc.Value;
						user.AccessFailedCount = 20;
						securityHelper.UserManager.Update(user);
					}
				} else {
					if (user.LockoutEndDateUtc.HasValue) {
						// unset lockout
						user.LockoutEndDateUtc = null;
						user.AccessFailedCount = 0;
						securityHelper.UserManager.Update(user);
					}
				}

				ExtendedUserData exUsr = new ExtendedUserData(userExt.UserId);

				exUsr.UserNickName = userExt.UserNickName;
				exUsr.FirstName = userExt.FirstName;
				exUsr.LastName = userExt.LastName;
				exUsr.UserBio = userExt.UserBio;

				exUsr.Save();

				model.SaveOptions();

				return RedirectToAction("UserEdit", new { @id = userExt.UserId });
			}

			Helper.HandleErrorDict(ModelState);

			return View(model);
		}
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:47,代码来源:CmsAdminController.cs


示例14: UserProfile

		public ActionResult UserProfile(ExtendedUserData model) {
			if (ModelState.IsValid) {
				IdentityResult result = securityHelper.UserManager.SetEmail(model.UserKey, model.Email);

				ExtendedUserData exUsr = new ExtendedUserData(SecurityData.CurrentUserIdentityName);

				exUsr.UserNickName = model.UserNickName;
				exUsr.FirstName = model.FirstName;
				exUsr.LastName = model.LastName;
				exUsr.UserBio = model.UserBio;

				exUsr.Save();

				if (result.Succeeded) {
					SetSaved();
					return RedirectToAction("UserProfile");
				}
			}

			Helper.HandleErrorDict(ModelState);

			return View(model);
		}
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:23,代码来源:CmsAdminController.cs


示例15: SiteRemoveUsers

		public ActionResult SiteRemoveUsers(SiteModel model) {
			ModelState.Clear();

			SiteData site = model.Site;

			if (ModelState.IsValid) {
				List<UserModel> usrs = model.Users.Where(x => x.Selected).ToList();

				foreach (var u in usrs) {
					ExtendedUserData exUsr = new ExtendedUserData(u.User.UserId);
					exUsr.RemoveFromSite(site.SiteID);
				}

				return RedirectToAction("SiteDetail", new { @id = site.SiteID });
			}

			Helper.HandleErrorDict(ModelState);

			return View("SiteDetail", model);
		}
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:20,代码来源:CmsAdminController.cs


示例16: RecordPageLock

        public bool RecordPageLock(Guid rootContentID, Guid siteID, Guid currentUserID)
        {
            bool bLock = IsPageLocked(rootContentID, siteID, currentUserID);
            bool bRet = false;

            if (!bLock) {
                ExtendedUserData usr = new ExtendedUserData(currentUserID);

                //only allow admin/editors to record a lock
                if (usr.IsAdmin || usr.IsEditor) {
                    bRet = RecordHeartbeatLock(rootContentID, siteID, currentUserID);
                }
            }

            return bRet;
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:16,代码来源:ContentPageHelper.cs


示例17: RecordSnippetLock

        public bool RecordSnippetLock(Guid currentUserID)
        {
            bool bLock = IsSnippetLocked();
            bool bRet = false;

            if (!bLock) {
                ExtendedUserData usr = new ExtendedUserData(currentUserID);

                //only allow admin/editors to record a lock
                if (usr.IsAdmin || usr.IsEditor) {
                    bRet = true;
                    RecordHeartbeatLock(currentUserID);
                }
            }

            return bRet;
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:17,代码来源:ContentSnippet.cs


示例18: Page_Load


//.........这里部分代码省略.........
				if (dictTemplates.Any() && dictTemplates.First().Value >= iThird) {
					try {
						GeneralUtilities.SelectListValue(ddlTemplate, dictTemplates.First().Key);
					} catch { }
				}

				if (pageContents == null) {
					btnDeleteButton.Visible = false;
				}

				if (pageContents != null) {
					bool bRet = pageHelper.RecordPageLock(pageContents.Root_ContentID, SiteData.CurrentSite.SiteID, SecurityData.CurrentUserGuid);

					if (pageContents.ContentType != ContentPageType.PageType.ContentEntry) {
						Response.Redirect(SiteFilename.BlogPostAddEditURL + "?id=" + Request.QueryString.ToString());
					}

					cmsHelper.OverrideKey(pageContents.Root_ContentID);
					cmsHelper.cmsAdminContent = pageContents;
					cmsHelper.cmsAdminWidget = pageContents.GetWidgetList();

					BindTextDataGrid();

					guidRootContentID = pageContents.Root_ContentID;
					hdnRootID.Value = guidRootContentID.ToString();

					txtOldFile.Text = pageContents.FileName;

					if (guidImportContentID != Guid.Empty) {
						txtOldFile.Text = "";
					}

					Dictionary<string, string> dataVersions = (from v in pageHelper.GetVersionHistory(SiteID, pageContents.Root_ContentID)
															   join u in ExtendedUserData.GetUserList() on v.EditUserId equals u.UserId
															   orderby v.EditDate descending
															   select new KeyValuePair<string, string>(v.ContentID.ToString(), string.Format("{0} ({1}) {2}", v.EditDate, u.UserName, (v.IsLatestVersion ? " [**] " : " ")))
																).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);

					GeneralUtilities.BindListDefaultText(ddlVersions, dataVersions, null, "Page Versions", "00000");

					bLocked = pageHelper.IsPageLocked(pageContents);

					pnlHB.Visible = !bLocked;
					pnlButtons.Visible = !bLocked;
					divEditing.Visible = bLocked;
					chkDraft.Visible = !bLocked;
					pnlHBEmpty.Visible = bLocked;

					if (bLocked && pageContents.Heartbeat_UserId != null) {
						MembershipUser usr = SecurityData.GetUserByGuid(pageContents.Heartbeat_UserId.Value);
						litUser.Text = "Read only mode. User '" + usr.UserName + "' is currently editing the page.";
					}

					txtTitle.Text = pageContents.TitleBar;
					txtNav.Text = pageContents.NavMenuText;
					txtHead.Text = pageContents.PageHead;
					txtFileName.Text = pageContents.FileName;
					txtThumb.Text = pageContents.Thumbnail;

					txtDescription.Text = pageContents.MetaDescription;
					txtKey.Text = pageContents.MetaKeyword;

					txtSort.Text = pageContents.NavOrder.ToString();

					lblUpdated.Text = pageContents.EditDate.ToString();
					lblCreateDate.Text = pageContents.CreateDate.ToString();
开发者ID:tridipkolkata,项目名称:CarrotCakeCMS,代码行数:67,代码来源:PageAddEdit.aspx.cs


示例19: OnPreRender

        protected override void OnPreRender(EventArgs e)
        {
            if (_usr == null) {
                _usr = ExtendedUserData.GetEditorFromURL();
            }
            if (_usr == null) {
                ContentPage cp = cu.GetContainerContentPage(this);
                if (this.SourceField == AuthorSource.Editor) {
                    _usr = cp.GetUserInfo();
                } else {
                    _usr = cp.GetCreditUserInfo();
                }
            }

            AssignUser();

            base.OnPreRender(e);
        }
开发者ID:mjohn,项目名称:CarrotCakeCMS,代码行数:18,代码来源:AuthorData.cs


示例20: GetUserInfo

 public ExtendedUserData GetUserInfo()
 {
     if (_user == null && this.EditUserId.HasValue) {
         _user = new ExtendedUserData(this.EditUserId.Value);
     }
     return _user;
 }
开发者ID:sunsiz,项目名称:CarrotCakeCMS,代码行数:7,代码来源:SiteNav.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Core.SearchParameterObject类代码示例发布时间:2022-05-24
下一篇:
C# Core.ContentPageType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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