Ejemplo n.º 1
0
        public static HRM_EmpFamily GetEmpGeneralInfo(long empKey)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            IDataReader       reader     = null;
            String            sql        = "EXEC GetGeneralInfo '" + empKey + "'";

            try
            {
                HRM_EmpFamily newHRM_EmpFamily = new HRM_EmpFamily();
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    newHRM_EmpFamily.SetDataEmp(reader);
                }
                return(newHRM_EmpFamily);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public static CustomList <HRM_EmpFamily> GetAllEmpFamByEmpKey(string empKey)
        {
            ConnectionManager          conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <HRM_EmpFamily> HRM_EmpFamilyCollection = new CustomList <HRM_EmpFamily>();
            IDataReader reader = null;
            String      sql    = "select * from HRM_EmpFamily where empkey = " + empKey;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    HRM_EmpFamily newHRM_EmpFamily = new HRM_EmpFamily();
                    newHRM_EmpFamily.SetData(reader);
                    HRM_EmpFamilyCollection.Add(newHRM_EmpFamily);
                }
                HRM_EmpFamilyCollection.InsertSpName = "spInsertHRM_EmpFamily";
                HRM_EmpFamilyCollection.UpdateSpName = "spUpdateHRM_EmpFamily";
                HRM_EmpFamilyCollection.DeleteSpName = "spDeleteHRM_EmpFamily";
                return(HRM_EmpFamilyCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }