本文整理汇总了C#中Carrotware.CMS.Core.ExtendedUserData类的典型用法代码示例。如果您正苦于以下问题:C# ExtendedUserData类的具体用法?C# ExtendedUserData怎么用?C# ExtendedUserData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExtendedUserData类属于Carrotware.CMS.Core命名空间,在下文中一共展示了ExtendedUserData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: FindUser
private Guid FindUser(Guid userId) {
ExtendedUserData usr = new ExtendedUserData(userId);
if (usr == null) {
return SecurityData.CurrentUserGuid;
} else {
return userId;
}
}
示例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;
}
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
}
示例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;
}
}
示例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";
}
示例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());
}
}
}
示例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);
}
}
}
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}