Beispiel #1
0
        public clsPromotionWeek[] GetActiveWeeks(clsPromotionWeek []proWeeks)
        {
            ArrayList arrs = new ArrayList();
            foreach(clsPromotionWeek proWeek in proWeeks)
            {
                if(proWeek.IsActive)
                {
                    arrs.Add(proWeek);
                }
            }

            int length = proWeeks.Length;

            int i = 0;

            clsPromotionWeek[] values = new clsPromotionWeek[length];
            foreach(clsPromotionWeek proWeek in arrs)
            {
                values[i] = proWeek;
                i ++;
            }
            return values;
        }
Beispiel #2
0
        /// <summary>
        /// Get the index of first active week
        /// </summary>
        /// <param name="proWeeks"></param>
        /// <returns></returns>
        /// <remarks>
        /// Author:			PhatLT. FPTSS.
        /// Created date:	14/02/2011
        /// </remarks>
        public int GetActiveWeekFrom(clsPromotionWeek []proWeeks)
        {
            int iActiveFrom = -1;
            int i = 0;
            foreach(clsPromotionWeek proWeek in proWeeks)
            {
                if(iActiveFrom == -1 && proWeek.IsActive)
                {
                    iActiveFrom = i;
                    return iActiveFrom;
                }

                i ++;
            }
            return proWeeks.Length;
        }