protected void setUpUserInfo() { string userName = HttpContext.Current.User.Identity.Name; MembershipUser theUser = Membership.GetUser(userName); userNameTopNavA.InnerText = userNameSideNav.InnerText = userNameTopNav.InnerText = theUser.UserName; userEmail.InnerText = theUser.Email; System.Web.Profile.ProfileBase profile = HttpContext.Current.Profile; //Use this to set profile picture //profile.SetPropertyValue("ProfilePicture", "img/SSSL.JPG"); //string defaultpic = "img/user-default.jpg"; string pic = profile.GetPropertyValue("ProfilePicture").ToString(); if (pic == "") { pic = "img/user-default.jpg"; } userImgSideNav.Src = pic; userImgTopNav.Src = pic; }
public virtual object GetPropertyValue(string propertyName) { return(_profileBase.GetPropertyValue(propertyName)); }
public void SetUserPassport(string userName, string passport) { lock (Database.lockObjectDB) { if (userName == "AkBarsAdmin" || userName == "UzcardAdmin") { return; } System.Web.Profile.ProfileBase pb = System.Web.Profile.ProfileBase.Create(userName); CardPerso.Administration.UserClass uc = (CardPerso.Administration.UserClass)pb.GetPropertyValue("UserData"); uc.Passport = passport; pb.SetPropertyValue("UserData", uc); pb.Save(); } }
public string UserPassport(string userName) { lock (Database.lockObjectDB) { if (userName == "AkBarsAdmin" || userName == "UzcardAdmin") { return("0000 000000"); } System.Web.Profile.ProfileBase pb = System.Web.Profile.ProfileBase.Create(userName); CardPerso.Administration.UserClass uc = (CardPerso.Administration.UserClass)pb.GetPropertyValue("UserData"); return(uc.Passport); } }
public string UserPosition(int userId) { lock (Database.lockObjectDB) { object obj = null; Database.ExecuteScalar($"select UserName from aspnet_users where id={userId}", ref obj, null); if (obj == null || obj == DBNull.Value) { return(""); } System.Web.Profile.ProfileBase pb = System.Web.Profile.ProfileBase.Create((string)obj); CardPerso.Administration.UserClass uc = (CardPerso.Administration.UserClass)pb.GetPropertyValue("UserData"); return(uc.Position); } }
public int BranchId(string userName) { String branchId = (String)HttpContext.Current.Session["BranchId"]; if (branchId != null) { String currentUserName = (String)HttpContext.Current.Session["CurrentUserName"]; if (currentUserName != null && userName.ToLower().Equals(currentUserName) == true) { return(Int32.Parse(branchId)); } } lock (Database.lockObjectDB) { if (userName == "AkBarsAdmin" || userName == "UzcardAdmin") { return(0); } System.Web.Profile.ProfileBase pb = System.Web.Profile.ProfileBase.Create(userName); CardPerso.Administration.UserClass uc = (CardPerso.Administration.UserClass)pb.GetPropertyValue("UserData"); return(uc.BranchId); } }