本文整理汇总了C#中SageFrame.Web.SageFrameConfig.GetSettingIntByKey方法的典型用法代码示例。如果您正苦于以下问题:C# SageFrameConfig.GetSettingIntByKey方法的具体用法?C# SageFrameConfig.GetSettingIntByKey怎么用?C# SageFrameConfig.GetSettingIntByKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SageFrame.Web.SageFrameConfig
的用法示例。
在下文中一共展示了SageFrameConfig.GetSettingIntByKey方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
SageFrameConfig pb = new SageFrameConfig();
IsUseFriendlyUrls = pb.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
//if (!IsPostBack)
//{
profileText = GetSageMessage("LoginStatus", "MyProfile");
Literal lnkProfileUrl = (Literal)LoginView1.TemplateControl.FindControl("lnkProfileUrl");
RegisterURL = pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage) + ".aspx";
if (pb.GetSettingsByKey(SageFrameSettingKeys.PortalShowProfileLink) == "1")
{
if (IsUseFriendlyUrls)
{
if (GetPortalID > 1)
{
profileURL = "<a href='" + ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalUserProfilePage) + ".aspx") + "'>" + profileText + "</a>";
}
else
{
profileURL = "<a href='" + ResolveUrl("~/" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalUserProfilePage) + ".aspx") + "'>" + profileText + "</a>";
}
}
else
{
profileURL = "<a href='" + ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalUserProfilePage)) + "'>" + profileText + "</a>";
}
}
else
{
profileURL = "";
}
if (IsUseFriendlyUrls)
{
if (GetPortalID > 1)
{
RegisterURL = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage) + ".aspx");
}
else
{
RegisterURL = ResolveUrl("~/" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage) + ".aspx");
}
}
else
{
RegisterURL = ResolveUrl("~/Default.aspx?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage));
}
if (HttpContext.Current.User != null)
{
if (HttpContext.Current.User.Identity.IsAuthenticated == true)
{
Label lblProfileURL = LoginView1.FindControl("lblProfileURL") as Label;
if (lblProfileURL != null)
{
if (profileURL != "")
{
lblProfileURL.Text = "<li>" + profileURL + "</li>";
lblProfileURL.Visible = true;
}
else
{
lblProfileURL.Visible = false;
}
}
else
{
Response.Redirect(pb.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage) + ".aspx");
}
}
}
int UserRegistrationType = pb.GetSettingIntByKey(SageFrameSettingKeys.PortalUserRegistration);
if (UserRegistrationType > 0)
{
RegisterURL = "<span class='cssClassRegister'><a href='" + RegisterURL + "'>" + GetSageMessage("LoginStatus", "Register") +"</a></span>";
}
else
{
RegisterURL = "";
}
//}
}
示例2: GetFormData
//.........这里部分代码省略.........
}
}
}
//RadioButtonList
if (pnlCon3.GetType() == typeof(RadioButtonList))
{
RadioButtonList rdbl = (RadioButtonList)pnlCon3;
if (rdbl != null)
{
string conID = rdbl.ID;
string[] IDColl = conID.Split("_".ToCharArray());
if (IDColl.Length > 0)
{
ProfileID = Int32.Parse(IDColl[1].ToString());
ProfileValue = rdbl.SelectedItem.Text;
}
}
}
//File Upload
if (pnlCon3.GetType() == typeof(FileUpload))
{
FileUpload asFlu = (FileUpload)pnlCon3;
if (asFlu != null)
{
if (asFlu.HasFile)
{
string Ext = asFlu.PostedFile.ContentType;
if (!string.IsNullOrEmpty(Ext))
Ext = Ext.Replace(".", "");
SageFrameConfig pagebase = new SageFrameConfig();
if (PictureManager.IsValidIImageTypeWitMime(Ext))
{
int MaxFileSize = (pagebase.GetSettingIntByKey(SageFrameSettingKeys.PortalUserProfileMaxImageSize) * 1024);//Converted MB in to KB
if (asFlu.PostedFile.ContentLength <= MaxFileSize)
{
string conID = asFlu.ID;
string[] IDColl = conID.Split("_".ToCharArray());
if (IDColl.Length > 0)
{
ProfileID = Int32.Parse(IDColl[1].ToString());
string path = HttpContext.Current.Server.MapPath("~/");
string MapPath = "Modules\\Admin\\UserManagement\\ProfileImage";
MapPath = Path.Combine(path, MapPath);
string savedPathMedium = "Modules\\Admin\\UserManagement\\ProfileImage\\MediumProfileImage";
savedPathMedium = Path.Combine(path, savedPathMedium);
string savedPathSmall = "Modules\\Admin\\UserManagement\\ProfileImage\\SmallProfileImage";
savedPathSmall = Path.Combine(path, savedPathSmall);
var folderPaths = db.sp_ProfileImageFoldersGet(EditUserName, ProfileID, GetPortalID);
foreach (sp_ProfileImageFoldersGetResult imageFolders in folderPaths)
{
DeleteImageFiles(MapPath + '\\' + imageFolders.Value);
DeleteImageFiles(savedPathMedium + '\\' + imageFolders.Value);
DeleteImageFiles(savedPathSmall + '\\' + imageFolders.Value);
}
char[] separator = new char[] { '.' };
string[] fileNames = asFlu.FileName.Split(separator);
string fileName = fileNames[0];
string extension = string.Empty;
if (fileNames.Length > 1)
{
extension = fileNames[fileNames.Length - 1];
}
fileName = PictureManager.GetFileName(fileName);
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
IncludeLanguageJS();
Extension = SageFrameSettingKeys.PageExtension;
SageFrameConfig pb = new SageFrameConfig();
IsUseFriendlyUrls = pb.GetSettingBollByKey(SageFrameSettingKeys.UseFriendlyUrls);
profileText = GetSageMessage("LoginStatus", "MyProfile");
Literal lnkProfileUrl = (Literal)LoginView1.TemplateControl.FindControl("lnkProfileUrl");
RegisterURL = pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage) + Extension;
if (pb.GetSettingsByKey(SageFrameSettingKeys.PortalShowProfileLink) == "1")
{
string profilepage = pb.GetSettingsByKey(SageFrameSettingKeys.PortalUserProfilePage);
profilepage = profilepage.ToLower().Equals("user-profile")
? string.Format("/sf/{0}", profilepage)
: string.Format("/{0}", profilepage);
if (GetPortalID > 1)
{
profileURL = "<a href='" + ResolveUrl("~/portal/" + GetPortalSEOName + profilepage + Extension) + "'>" +
profileText + "</a>";
}
else
{
profileURL = "<a href='" + ResolveUrl("~" + profilepage + Extension) + "'>" + profileText + "</a>";
}
}
else
{
profileURL = string.Empty;
}
string userName = GetUsername;
if (userName.ToLower() == "anonymoususer")
{
divAnonymousTemplate.Visible = true;
divLoggedInTemplate.Visible = false;
userName = "Guest";
}
else
{
divAnonymousTemplate.Visible = false;
divLoggedInTemplate.Visible = true;
}
// Label lblWelcomeMsg = LoginView1.FindControl("lblWelcomeMsg") as Label;
// lblWelcomeMsg.Text = "<h2><span onload='GetMyLocale(this)'>Welcome " + userName + "!</span></h2>";
lblWelcomeMsg.Text = lblWelcomeMsg.Text + " " + userName;
if (IsUseFriendlyUrls)
{
if (GetPortalID > 1)
{
RegisterURL = ResolveUrl("~/portal/" + GetPortalSEOName + "/" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage) + Extension);
}
else
{
RegisterURL = ResolveUrl("~/" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage) + Extension);
}
}
else
{
RegisterURL = ResolveUrl("~/Default" + Extension + "?ptlid=" + GetPortalID + "&ptSEO=" + GetPortalSEOName + "&pgnm=" + pb.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage));
}
int UserRegistrationType = pb.GetSettingIntByKey(SageFrameSettingKeys.PortalUserRegistration);
if (UserRegistrationType > 0)
{
RegisterURL = "<span><a href='" + RegisterURL + "'>" + GetSageMessage("LoginStatus", "Register") + "</a></span>";
}
else
{
RegisterURL = "";
}
}
示例4: RegisterUser
public int RegisterUser(int storeID, int portalID, string firstName, string userName, string lastName, string password, string email)
{
SageFrameConfig pagebase = new SageFrameConfig();
MembershipController _member = new MembershipController();
int returnValue = 0;
try
{
if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(firstName) || string.IsNullOrEmpty(lastName) || string.IsNullOrEmpty(email))
{
returnValue = 1;// ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("UserRegistration", "PleaseEnterAllRequiredFields"), "", SageMessageType.Alert);
}
else
{
int UserRegistrationType = pagebase.GetSettingIntByKey(SageFrameSettingKeys.PortalUserRegistration);
bool isUserActive = UserRegistrationType == 2 ? true : false;
UserInfo objUser = new UserInfo();
objUser.ApplicationName = Membership.ApplicationName;
objUser.FirstName = firstName;
objUser.UserName = userName;
objUser.LastName = lastName;
string Pwd, PasswordSalt;
PasswordHelper.EnforcePasswordSecurity(_member.PasswordFormat, password, out Pwd, out PasswordSalt);
objUser.Password = Pwd;
objUser.PasswordSalt = PasswordSalt;
objUser.Email = email;
objUser.SecurityQuestion = "";
objUser.SecurityAnswer = "";
objUser.IsApproved = true;
objUser.CurrentTimeUtc = DateTime.Now;
objUser.CreatedDate = DateTime.Now;
objUser.UniqueEmail = 0;
objUser.PasswordFormat = _member.PasswordFormat;
objUser.PortalID = portalID;
objUser.AddedOn = DateTime.Now;
objUser.AddedBy = "";
objUser.UserID = Guid.NewGuid();
objUser.RoleNames = SystemSetting.REGISTER_USER_ROLENAME;
objUser.StoreID = storeID;
objUser.CustomerID = 0;
UserCreationStatus status = new UserCreationStatus();
//CheckRegistrationType(UserRegistrationType, ref objUser);
int customerId;
string sessionCode;
sessionCode = GetSessionCode();
MembershipDataProvider.RegisterPortalUser(objUser, out status, out customerId, UserCreationMode.REGISTER);
if (status == UserCreationStatus.DUPLICATE_USER)
{
returnValue = 2;// ShowMessage(SageMessageTitle.Notification.ToString(), UserName.Text.Trim() + " " + GetSageMessage("UserManagement", "NameAlreadyExists"), "", SageMessageType.Alert);
//GenerateCaptchaImage();
}
else if (status == UserCreationStatus.DUPLICATE_EMAIL)
{
returnValue = 3; //ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("UserManagement", "EmailAddressAlreadyIsInUse"), "", SageMessageType.Alert);
//GenerateCaptchaImage();
}
else if (status == UserCreationStatus.SUCCESS)
{
UpdateCartAnonymoususertoRegistered(storeID, portalID, customerId, sessionCode);
returnValue = 4;
}
}
}
catch (Exception ex)
{
throw ex; // ProcessException(ex);
}
return returnValue;
}