Ejemplo n.º 1
0
        public static CustomList <ShiftRuleDetail> GetAllShiftRuleDetail()
        {
            ConnectionManager            conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <ShiftRuleDetail> ShiftRuleDetailCollection = new CustomList <ShiftRuleDetail>();
            IDataReader reader = null;
            String      sql    = "select SRD.*,SP.ALISE from ShiftRuleDetail SRD INNER JOIN ShiftPlan SP ON SP.ShiftID=SRD.ShiftID";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ShiftRuleDetail newShiftRuleDetail = new ShiftRuleDetail();
                    newShiftRuleDetail.SetDataShiftRoster(reader);
                    ShiftRuleDetailCollection.Add(newShiftRuleDetail);
                }
                return(ShiftRuleDetailCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Ejemplo n.º 2
0
        public static CustomList <ShiftRuleDetail> GetAllShiftRuleDetail(int ShiftRuleKey)
        {
            ConnectionManager            conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <ShiftRuleDetail> ShiftRuleDetailCollection = new CustomList <ShiftRuleDetail>();
            IDataReader reader = null;
            String      sql    = "select *from ShiftRuleDetail Where ShiftRuleKey='" + ShiftRuleKey + "'";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ShiftRuleDetail newShiftRuleDetail = new ShiftRuleDetail();
                    newShiftRuleDetail.SetData(reader);
                    ShiftRuleDetailCollection.Add(newShiftRuleDetail);
                }
                return(ShiftRuleDetailCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }