public int AddTotalizator(int organaizerId, int stage, string tTitle, PointsAnalysisView tPoints, string tAccess) { var organaizer = unitOfWork.UserRepository.Get(organaizerId); var index = unitOfWork.TotalizatorRepository.AddTotalizator(organaizerId, stage, tTitle, tPoints, tAccess); return(index); }
public int AddTotalizator(int organaizerId, int stage, string tTitle, PointsAnalysisView tPoints, string tAccess) { bool isPublic = true; DateTime ValidDate = DateService.getValidDate(stage, context); if (tAccess == "Private") { isPublic = false; } int totalizatorId = GetNextIndex(); var pA = new PointsAnalysis() { Full = tPoints.Full, GoalDif = tPoints.GoalDif, JustWinner = tPoints.JustWinner, TotalizatorId = totalizatorId }; context.PointsAnalysis.Add(pA); var totalizator = new Totalizator() { Name = tTitle, TotalizatorId = totalizatorId, OrganaizerId = organaizerId, StageId = stage, Validity = ValidDate, isPublic = isPublic }; context.Totalizators.Add(totalizator); context.SaveChanges(); return(totalizatorId); }
public JsonResult GetBlankPointAnalysisView() { var pointAnalysis = new PointsAnalysisView(); return(Json(pointAnalysis, JsonRequestBehavior.AllowGet)); }