Example #1
0
        public UserSecuritys GetsByString(string sString)
        {
            UserSecuritys oUserSecuritys = new UserSecuritys();

            try
            {
                SqlCommand cmd = new SqlCommand("SP_UserSecurity_GetsByString", _conn);

                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter("@USID", SqlDbType.VarChar)).Value = sString;
                if (_conn.State == ConnectionState.Open)
                {
                }
                else
                {
                    cmd.Connection.Open();
                }
                IDataReader reader = cmd.ExecuteReader();

                oUserSecuritys = CreateObjects(reader);
                reader.Close();
                cmd.Dispose();
                cmd.Connection.Close();
            }
            catch (Exception e)
            {
                throw new ServiceException(e.Message, e);
            }
            return(oUserSecuritys);
        }
Example #2
0
        public UserSecuritys Gets()
        {
            UserSecuritys oUserSecuritys = new UserSecuritys();

            try
            {
                SqlCommand cmd = new SqlCommand("SP_UserSecurity_Gets", _conn);

                cmd.CommandType = CommandType.StoredProcedure;
                if (_conn.State == ConnectionState.Open)
                {
                }
                else
                {
                    cmd.Connection.Open();
                }
                IDataReader reader = cmd.ExecuteReader();

                oUserSecuritys = CreateObjects(reader);
                reader.Close();
                cmd.Dispose();
                cmd.Connection.Close();
            }
            catch (Exception e)
            {
                throw new ServiceException(e.Message, e);
            }
            return(oUserSecuritys);
        }
Example #3
0
        private UserSecuritys CreateObjects(IDataReader oReader)
        {
            UserSecuritys oUserSecuritys = new UserSecuritys();
            NullHandler   oHandler       = new NullHandler(oReader);

            while (oReader.Read())
            {
                UserSecurity oItem = CreateObject(oHandler);
                oUserSecuritys.Add(oItem);
            }
            return(oUserSecuritys);
        }