public ActionResult AddSeminarWithLink(decimal groupID, bool isIntramural) { var user = AuthService.CurrentUser; var group = GroupService.GetByPK(groupID); if ((group.IsProbWeb || group.IsSeminar) && !group.IsCareerDay && NeedExport(groupID)) { var orderDetail = new OrderDetail { Group_ID = groupID, PriceType_TC = (isIntramural || !group.WebinarExists) ? PriceTypes.PrivatePersonWeekend : PriceTypes.Webinar, OrderExtras = new EntitySet <OrderExtras>() }; var order = new Order() { OrderExams = new EntitySet <OrderExam>(), OrderDetails = new EntitySet <OrderDetail> { orderDetail }, User = user }; try { SpecialistExportService.Export(order, true); }catch (Exception e) { Logger.Exception(e, User); return(BaseView(new PagePart("Группа заполнена"))); } } var seminar = new GroupSeminar(group); MailService.SeminarComplete(seminar, Url.ComplexLinkAnchor(group.Complex).AbsoluteHref().ToString()); return(RedirectToAction <CourseController>(c => c.SeminarComplete(groupID))); }
public ActionResult Export(int orderID) { try { SpecialistExportService.Export(orderID, false, null); } catch (Exception e) { if (e.Message.StartsWith(CommonTexts.FullGroupError)) { return(Content("Экспорт невозможен. Группа заполнена")); } throw; } return(RedirectBack()); }