Пример #1
0
 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);
     }
 }
Пример #2
0
 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();
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
        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);
            }
        }