Пример #1
0
/*
 *              [HttpPost]
 *              public ActionResult AddWebinarRecord(string courseTC) {
 *                      CartService.AddWebinarRecord(courseTC);
 *                      return BackOrDetails();
 *              }
 */


        private bool AddIfHalfTrack(string courseTC, string priceTypeTC = null)
        {
            if (!CourseTC.HalfTrackCourses.Contains(courseTC))
            {
                return(false);
            }
            var trackTC = CourseTC.HalfTracks.First(x => x.Value.Contains(courseTC)).Key;

            CartService.AddTrack(trackTC, priceTypeTC);
            return(true);
        }
Пример #2
0
 public ActionResult AddCourse(string courseTC, string priceTypeTC)
 {
     courseTC    = courseTC.ToUpper();
     priceTypeTC = CorrectPriceTypeByUser(priceTypeTC);
     if (CourseService.IsTrack(courseTC))
     {
         CartService.AddTrack(courseTC, priceTypeTC);
     }
     else
     {
         if (!AddIfHalfTrack(courseTC, priceTypeTC))
         {
             CartService.AddCourse(courseTC, priceTypeTC);
         }
     }
     return(BackOrDetails());
 }