示例#1
0
        public bool AddExam(decimal examID)
        {
            var order = OrderService.GetOrCreateCurrentOrder();

            if (order.HasCourses)
            {
                return(false);
            }
            if (order.OrderExams.Any(oe => oe.Exam_ID == examID))
            {
                return(true);
            }

            var exam = ExamService.GetByPK(examID);

            if (!exam.ExamPrice.HasValue)
            {
                return(true);
            }

            var orderExam = new OrderExam
            {
                Exam_ID = examID,
                Price   = exam.ExamPrice.GetValueOrDefault()
            };

            order.OrderExams.Add(orderExam);
            OrderService.SubmitChanges();
            return(true);
        }
示例#2
0
 public static ListRow FromOrderExam(OrderExam od)
 {
     return(new ListRow("exam" + od.Exam_ID, 1, (int)od.Price, od.Exam.ExamName));
 }