Пример #1
0
        public static BJUserInfo GetUserById(int changer)
        {
            BJUserLoader loader = new BJUserLoader("BJVVV");
            BJUserInfo   result = loader.GetUserById(changer);

            return(result);
        }
Пример #2
0
        public static BJUserInfo GetUserByLogin(string login, string fund)
        {
            BJUserLoader loader = new BJUserLoader(fund);
            BJUserInfo   result = loader.GetUserByLogin(login.ToUpper());

            return(result);
        }
Пример #3
0
        public BJUserInfo GetUserByLogin(string login)
        {
            DataTable table = wrapper.GetUserByLogin(login, fund);

            if (table.Rows.Count == 0)
            {
                return(null);
            }
            BJUserInfo result = new BJUserInfo();

            result.Id         = Convert.ToInt32(table.Rows[0]["ID"]);
            result.Login      = login;
            result.HashedPwd  = table.Rows[0]["HASH"].ToString();
            result.FIO        = table.Rows[0]["FIO"].ToString();
            result.UserStatus = new List <UserStatus>();
            foreach (DataRow row in table.Rows)
            {
                UserStatus us = new UserStatus();
                us.DepId    = Convert.ToInt32(row["DepId"]);
                us.DepName  = row["DepName"].ToString();
                us.RoleId   = Convert.ToInt32(row["IDROLE"]);
                us.RoleName = row["ROLE"].ToString();
                result.UserStatus.Add(us);
            }
            return(result);
        }
Пример #4
0
    public ReaderLib(string login, string sess, LibflClassLibrary.BJUsers.BJUserInfo bjUser)
    {
        //SqlDataAdapter DA = new SqlDataAdapter();
        //DA.SelectCommand = new SqlCommand();
        //DA.SelectCommand.Connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["BJVVV"].ConnectionString);
        //DA.SelectCommand.Parameters.Clear();
        //DA.SelectCommand.Parameters.AddWithValue("LOGIN", login.ToLower());
        //DA.SelectCommand.CommandText = "select USERS.ID id,USERS.NAME name,USERS.LOGIN login,dpt.NAME dname from BJVVV..USERS join BJVVV..LIST_8 dpt on USERS.DEPT = dpt.ID where lower([LOGIN]) = @LOGIN";

        //DataSet DS = new DataSet();
        //int recc = DA.Fill(DS, "Employee");
        this.ID      = bjUser.Id.ToString();              //DS.Tables["Employee"].Rows[0]["id"].ToString();
        this.Login   = bjUser.Login;                      //DS.Tables["Employee"].Rows[0]["login"].ToString();
        this.Name    = bjUser.FIO;                        // DS.Tables["Employee"].Rows[0]["name"].ToString();
        this.Dep     = bjUser.SelectedUserStatus.DepName; //DS.Tables["Employee"].Rows[0]["dname"].ToString();
        this.Session = sess;
        this.DepId   = bjUser.SelectedUserStatus.DepId;
        //DA.SelectCommand.Connection.Close();
    }