Ejemplo n.º 1
0
        /// <summary>
        /// Returns the user's name given a user id
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public string GetUserName(string userId)
        {
            string commandText = "Select Name from Users where Id = @id";
            Dictionary <string, object> parameters = new Dictionary <string, object>()
            {
                { "@id", userId }
            };

            return(_database.GetStrValue(commandText, parameters));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a role name given the roleId
        /// </summary>
        /// <param name="roleId">The role Id</param>
        /// <returns>Role name</returns>
        public string GetRoleName(string roleId)
        {
            string commandText = "Select Name from Roles where Id = @id";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@id", roleId);

            return(_database.GetStrValue(commandText, parameters));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Return a userId given a user's login
        /// </summary>
        /// <param name="userLogin">The user's login info</param>
        /// <returns></returns>
        public string FindUserIdByLogin(UserLoginInfo userLogin)
        {
            string commandText = "Select UserId from UserLogins where LoginProvider = @loginProvider and ProviderKey = @providerKey";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("loginProvider", userLogin.LoginProvider);
            parameters.Add("providerKey", userLogin.ProviderKey);

            return(_database.GetStrValue(commandText, parameters));
        }
Ejemplo n.º 4
0
        protected void ChangeDDLDesignationAsDDLTeacher(object obj, EventArgs e)
        {
            MySQLDatabase db = new MySQLDatabase();

            ddlDesignation.SelectedValue = db.GetStrValue(
                "getDesignationIdByTUId",
                new Dictionary <string, object>()
            {
                { "TId", ddlTeacher.SelectedValue }
            },
                true);
        }