コード例 #1
0
ファイル: FrequencyBL.cs プロジェクト: AlohaGEM-CRM/Summit
        public int CompareTo(FrequencyBL au2, FrequencyBLComparer.ComparisonType comparisonType)
        {
            FrequencyBLComparer.ComparisonType baseComparisonType = comparisonType;
            Int32 compareResult = 0;
            Int32 descFlag      = 1; //-1 for descending, + 1 for ascending, multiply by compare result

            switch (comparisonType)
            {
            case FrequencyBLComparer.ComparisonType.iDays:
                descFlag      = 1;
                compareResult = iDays.CompareTo(au2.iDays);
                break;

            case FrequencyBLComparer.ComparisonType.strFrequency:
                descFlag      = 1;
                compareResult = strFrequency.CompareTo(au2.strFrequency);
                break;

            default:
                descFlag      = 1;
                compareResult = iDays.CompareTo(au2.iDays);
                break;
            }
            return(compareResult * descFlag); //desc flag of -1 returns negative result for descending sort
        }
コード例 #2
0
ファイル: FrequencyBL.cs プロジェクト: AlohaGEM-CRM/Summit
        private static List <FrequencyBL> BuildFromTable(DataTable dtTable)
        {
            List <FrequencyBL> list = new List <FrequencyBL>();

            if (dtTable != null)
            {
                foreach (DataRow dr in dtTable.Rows)
                {
                    FrequencyBL thisMember = new FrequencyBL(dr);
                    list.Add(thisMember);
                }
            }
            return(list);
        }