예제 #1
0
파일: Users.cs 프로젝트: samnuriu13/APIXERP
        public static Users GetDefaultApplicationByUserCode(string userCode)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            IDataReader       reader     = null;


            conManager.OpenDataReader(out reader, "spWebGetDefaultApplicationByUserCode", userCode);
            try
            {
                Users user = new Users();
                while (reader.Read())
                {
                    user.SetData(reader);
                    break;
                }
                return(user);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
예제 #2
0
파일: Users.cs 프로젝트: samnuriu13/APIXERP
        public static Users GetUserInfoByEmployeeCode(String employeeCode)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            IDataReader       reader     = null;
            String            sql        = String.Format("Select * From [User] Where EmployeeCode = '{0}'", employeeCode);

            try
            {
                conManager.OpenDataReader(sql, out reader);
                Users user = new Users();
                while (reader.Read())
                {
                    user.SetData(reader);
                    break;
                }
                return(user);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
예제 #3
0
파일: Users.cs 프로젝트: samnuriu13/APIXERP
        public static CustomList <Users> doSearch(string whereClause)
        {
            ConnectionManager  conManager      = new ConnectionManager(ConnectionName.SysMan);
            CustomList <Users> UsersCollection = new CustomList <Users>();
            IDataReader        reader          = null;
            String             sql             = string.Format("Select * From [User] Where 1=1 {0}", whereClause);

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Users newUsers = new Users();
                    newUsers.SetData(reader);
                    UsersCollection.Add(newUsers);
                }
                return(UsersCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
예제 #4
0
파일: Users.cs 프로젝트: samnuriu13/APIXERP
 public static Users GetUserInfoByEmployeeCode(String employeeCode)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     IDataReader reader = null;
     String sql = String.Format("Select * From [User] Where EmployeeCode = '{0}'", employeeCode);
     try
     {
         conManager.OpenDataReader(sql, out reader);
         Users user = new Users();
         while (reader.Read())
         {
             user.SetData(reader);
             break;
         }
         return user;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
예제 #5
0
파일: Users.cs 프로젝트: samnuriu13/APIXERP
        public static Users GetDefaultApplicationByUserCode(string userCode)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            IDataReader reader = null;

            conManager.OpenDataReader(out reader, "spWebGetDefaultApplicationByUserCode", userCode);
            try
            {
                Users user = new Users();
                while (reader.Read())
                {
                    user.SetData(reader);
                    break;
                }
                return user;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }
                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
예제 #6
0
파일: Users.cs 프로젝트: samnuriu13/APIXERP
 public static CustomList<Users> doSearch(string whereClause)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<Users> UsersCollection = new CustomList<Users>();
     IDataReader reader = null;
     String sql = string.Format("Select * From [User] Where 1=1 {0}", whereClause);
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Users newUsers = new Users();
             newUsers.SetData(reader);
             UsersCollection.Add(newUsers);
         }
         return UsersCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }