コード例 #1
0
        public BindingList <DM_USER> SelectBindingAllDM_USER()
        {
            BindingList <DM_USER> dm_user = new BindingList <DM_USER>();
            DbDataReader          reader  = null;
            DbConnection          conn    = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[DM_USER_SelectAll]", (DbParameter[])null);
                if (reader.HasRows)
                {
                    DM_USERDataAccess.SetBindingListDM_USERInfo(ref reader, ref dm_user);
                }
                return(dm_user);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" DM_USERDataAccess.SelectAll: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #2
0
        public DM_USER DM_UserNameAndIDOrganization(string MA_DVIQLY, string Name)
        {
            DM_USER      dm_user = new DM_USER();
            DbDataReader reader  = null;
            DbConnection conn    = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_IDMA_DVIQLY, MA_DVIQLY, false));
                para.Add(_DbHelper.CreateParameter(FIELD_USERNAME, Name, false));

                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[DM_UserNameAndIDOrganization]", para.ToArray());
                if (reader.HasRows && reader.Read())
                {
                    DM_USERDataAccess.SetDM_USERInfo(reader, ref dm_user);
                }
                return(dm_user);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("DM_USERDataAccess.DM_UserNameAndIDOrganization: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #3
0
        public DM_USER SelectDM_USER(int IDUSER)
        {
            DM_USER      dm_user = new DM_USER();
            DbDataReader reader  = null;
            DbConnection conn    = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                List <DbParameter> para = new List <DbParameter>();
                para.Add(_DbHelper.CreateParameter(FIELD_IDUSER, IDUSER, false));

                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[DM_USER_SelectById]", para.ToArray());
                if (reader.HasRows && reader.Read())
                {
                    DM_USERDataAccess.SetDM_USERInfo(reader, ref dm_user);
                }
                return(dm_user);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("DM_USERDataAccess.SelectById: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #4
0
        public List <DM_USER> SelectAllSYS_User_NotIsActive(int IDMA_DVIQLY)
        {
            List <DM_USER> dm_user = new List <DM_USER>();
            DbDataReader   reader  = null;
            DbConnection   conn    = _DbHelper.CreateConnection(Common.ConnectionString);

            conn.Open();
            try
            {
                //List<DbParameter> para = new List<DbParameter>();
                //para.Add(_DbHelper.CreateParameter(FIELD_IDMA_DVIQLY, IDMA_DVIQLY, false));
                reader = _DbHelper.ExecuteReader(conn, Common.DatabaseSchema + "[SelectAllSYS_User_NotIsActive]", null);
                if (reader.HasRows)
                {
                    DM_USERDataAccess.SetListDM_USER(ref reader, ref dm_user);
                }
                return(dm_user);
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format(" DM_USERDataAccess.SelectAllSYS_User_NotIsActive: {0}", ex.Message));
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
                conn.Close();
            }
        }
コード例 #5
0
        private static void SetBindingListDM_USERInfo(ref DbDataReader reader, ref BindingList <DM_USER> dm_users)
        {
            DM_USER dm_user = null;

            while (reader.Read())
            {
                dm_user = new DM_USER();
                DM_USERDataAccess.SetDM_USERInfo(reader, ref dm_user);
                dm_users.Add(dm_user);
            }
        }