예제 #1
0
 // 招生统计报表-招生排名
 public List<SignUpRankingListItem> GetSignUpRankingList(DateTime? startTime, DateTime? endTime, string orderBy, string rankBy)
 {
     string o = "SignUpQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
     if (!String.IsNullOrEmpty(orderBy)) {
         switch (orderBy.ToLower()) {
             case "signupqty":
                 o = "SignUpQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "dropinqty":
                 o = "DropInQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "telsignupqty":
                 o = "TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "nontelsignupqty":
                 o = "NonTelSignUpQty DESC, TelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "teldropinqty":
                 o = "TelDropInQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "nonteldropinqty":
                 o = "NonTelDropInQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             case "signuprate":
                 o = "SignUpRate DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, DropInRate DESC";
                 break;
             case "dropinrate":
                 o = "DropInRate DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC";
                 break;
             case "telqty":
                 o = "TelQty DESC, TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
             default:
                 o = "TelSignUpQty DESC, NonTelSignUpQty DESC, TelDropInQty DESC, NonTelDropInQty DESC, SignUpRate DESC, DropInRate DESC";
                 break;
         }
     }
     var ds = new ReportRepository();
     if (startTime == null || endTime == null) {
         var n = 0;
         switch (DateTime.Today.DayOfWeek) {
             case DayOfWeek.Monday:
                 n = -1;
                 break;
             case DayOfWeek.Tuesday:
                 n = -2;
                 break;
             case DayOfWeek.Wednesday:
                 n = -3;
                 break;
             case DayOfWeek.Thursday:
                 n = -4;
                 break;
             case DayOfWeek.Friday:
                 n = -5;
                 break;
             case DayOfWeek.Saturday:
                 n = -6;
                 break;
             default:
                 break;
         }
         startTime = DateTime.Today.AddDays(n);
         endTime = startTime.Value.AddDays(8);
     }
     if (startTime == null) {
         startTime = new DateTime(2000, 1, 1);
     }
     if (endTime == null) {
         endTime = new DateTime(2099, 12, 31);
     }
     var m = ds.GetSignUpRankingList(startTime.Value, endTime.Value, o, (String.IsNullOrEmpty(rankBy) ? "SignUpQty" : rankBy));
     return m;
 }