private Period GetNextPeriod(Period crnt)
        {
            if (crnt == null)
            {
                throw new Exception("Period Not Found");
            }
            IList     periods  = PeriodRepository.LoadAll(m_command);
            ArrayList periodss = (ArrayList)periods;

            periodss.Sort(new PeriodComparer());
            int crntdx = periods.IndexOf(crnt);
            int next   = crntdx - 1;

            if (next > periods.Count)
            {
                return(null);
            }
            return(periods[next] as Period);
        }
        public Period GetPrevPeriod(Period crnt)
        {
            if (crnt == null)
            {
                throw new Exception("Period Not Found");
            }
            IList     periods  = PeriodRepository.LoadAll(m_command);
            ArrayList periodss = (ArrayList)periods;

            periodss.Sort(new PeriodComparer());
            int crntdx = periods.IndexOf(crnt);
            int prev   = crntdx + 1;

            if (prev < 0)
            {
                return(null);
            }
            if (prev > (periodss.Count - 1))
            {
                return(null);
            }
            return(periods[prev] as Period);
        }