コード例 #1
0
        public static HRM_EmpFileAttach GetEmpfileByEmpKey(long EmpKey)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            //CustomList<HRM_EmpFileAttach> HRM_EmpFileAttachCollection = new CustomList<HRM_EmpFileAttach>();
            IDataReader reader = null;
            String      sql    = "select * from HRM_EmpFileAttach where empkey = " + EmpKey;

            try
            {
                HRM_EmpFileAttach newHRM_EmpFileAttach = new HRM_EmpFileAttach();
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    newHRM_EmpFileAttach.SetData(reader);
                }
                return(newHRM_EmpFileAttach);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
コード例 #2
0
        public static CustomList <HRM_EmpFileAttach> GetAllEmpfileByEmpKey(string EmpKey)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HRM_EmpFileAttach> HRM_EmpFileAttachCollection = new CustomList <HRM_EmpFileAttach>();
            IDataReader reader = null;
            String      sql    = "select * from HRM_EmpFileAttach where empkey = " + EmpKey;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HRM_EmpFileAttach newHRM_EmpFileAttach = new HRM_EmpFileAttach();
                    newHRM_EmpFileAttach.SetData(reader);
                    HRM_EmpFileAttachCollection.Add(newHRM_EmpFileAttach);
                }
                HRM_EmpFileAttachCollection.InsertSpName = "spInsertHRM_EmpFileAttach";
                HRM_EmpFileAttachCollection.UpdateSpName = "spUpdateHRM_EmpFileAttach";
                HRM_EmpFileAttachCollection.DeleteSpName = "spDeleteHRM_EmpFileAttach";
                return(HRM_EmpFileAttachCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }