private SupplementCycleDefinition createCycle() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "bcaa"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 4; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.CardioTrainingDay, DosageType.Grams, TimeType.OnEmptyStomach); dosageDto.DosageUnit = DosageUnit.ON10KgWight; week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.CardioTrainingDay, DosageType.Grams, TimeType.BeforeWorkout); dosageDto.DosageUnit = DosageUnit.ON10KgWight; week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.CardioTrainingDay, DosageType.Grams, TimeType.AfterWorkout); dosageDto.DosageUnit = DosageUnit.ON10KgWight; week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(1, bcaa, SupplementCycleDayRepetitions.NonTrainingDay, DosageType.Grams, TimeType.OnEmptyStomach); dosageDto.DosageUnit = DosageUnit.ON10KgWight; week.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCreating2DTDefinition() { var supplementDTO = supplement.Map <SuplementDTO>(); var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Language = "en"; cycleDefinition.Name = "creatine cycle"; SupplementCycleWeekDTO trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; trainingWeek.CycleWeekStart = 1; trainingWeek.CycleWeekEnd = 4; cycleDefinition.Weeks.Add(trainingWeek); SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 5; dosageDto.DosageType = Service.V2.Model.DosageType.Grams; dosageDto.Supplement = supplementDTO; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 5; dosageDto.DosageType = Service.V2.Model.DosageType.Grams; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Supplement = supplementDTO; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeSleep; trainingWeek.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCreatingStormAndShockTherapyDefinition() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "storm and shock therapy"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; trainingWeek.CycleWeekStart = 1; trainingWeek.CycleWeekEnd = 6; cycleDefinition.Weeks.Add(trainingWeek); SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = shock; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; trainingWeek.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCycle() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "creatine cycle"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 1; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 400; dosageDto.DosageType = Service.V2.Model.DosageType.MiliGrams; dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek; dosageDto.Supplement = nandrolon; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; week.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 500; dosageDto.DosageType = Service.V2.Model.DosageType.MiliGrams; dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek; dosageDto.Supplement = testosteron; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 2; week.CycleWeekEnd = 16; cycleDefinition.Weeks.Add(week); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 400; dosageDto.DosageType = Service.V2.Model.DosageType.MiliGrams; dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek; dosageDto.Supplement = nandrolon; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; week.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 250; dosageDto.DosageType = Service.V2.Model.DosageType.MiliGrams; dosageDto.Repetitions = SupplementCycleDayRepetitions.OnceAWeek; dosageDto.Supplement = testosteron; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; week.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCycleForRepetitions1() { var suppleDTO = supplement.Map <SuplementDTO>(); var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "sterydy"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 2; week.IsRepetitable = false; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = CreateDosageDTO(400, suppleDTO); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 3; week.CycleWeekEnd = 4; week.IsRepetitable = false; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(401, suppleDTO); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 5; week.CycleWeekEnd = 6; week.IsRepetitable = false; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(300, suppleDTO); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 7; week.CycleWeekEnd = 7; week.IsRepetitable = false; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(410, suppleDTO); week.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCycle() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "bcaa"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 4; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = CreateDosageDTO(5, bcaa, Service.V2.Model.SupplementCycleDayRepetitions.EveryDay, Service.V2.Model.DosageType.Tablets, Service.V2.Model.TimeType.OnEmptyStomach); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(5, bcaa, Service.V2.Model.SupplementCycleDayRepetitions.EveryDay, Service.V2.Model.DosageType.Tablets, Service.V2.Model.TimeType.BeforeWorkout); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(5, bcaa, Service.V2.Model.SupplementCycleDayRepetitions.EveryDay, Service.V2.Model.DosageType.Tablets, Service.V2.Model.TimeType.AfterWorkout); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 1; cycleDefinition.Weeks.Add(week); var measurement = new SupplementCycleMeasurementDTO(); measurement.Repetitions = Service.V2.Model.SupplementCycleDayRepetitions.OnceAWeek; week.Dosages.Add(measurement); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 5; week.CycleWeekEnd = 5; cycleDefinition.Weeks.Add(week); measurement = new SupplementCycleMeasurementDTO(); measurement.Repetitions = Service.V2.Model.SupplementCycleDayRepetitions.OnceAWeek; week.Dosages.Add(measurement); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
//public PagedResult<SupplementCycleDefinitionDTO> GetSupplementsCycleDefinitions(GetSupplementsCycleDefinitionsParam param, PartialRetrievingInfo pageInfo) //{ // Log.WriteWarning("GetSupplementsCycleDefinitions:Username={0}", SecurityInfo.SessionData.Profile.UserName); // using (var transactionScope = Session.BeginTransaction()) // { // //var dbProfile = Session.Load<Profile>(SecurityInfo.SessionData.Profile.Id); // SupplementCycleDosage dosage = null; // SupplementCycleWeek week = null; // var myProfile = Session.Load<Profile>(SecurityInfo.SessionData.Profile.Id); // var loggedProfile = Session.Load<Profile>(SecurityInfo.SessionData.Profile.Id); // if (param.UserId.HasValue) // { // myProfile = Session.Load<Profile>(param.UserId.Value); // } // var ids = myProfile.FavoriteSupplementCycleDefinitions.Select(x => x.GlobalId).ToList(); // //this commented query works where some definitions don't have weeks and/or dosages // //var queryCustomer = Session.QueryOver<SupplementCycleDefinition>().JoinAlias(x => x.Weeks, () => week, JoinType.LeftOuterJoin).JoinAlias(x => x.Weeks.First().Dosages, () => dosage, JoinType.LeftOuterJoin); // var queryCustomer = // Session.QueryOver<SupplementCycleDefinition>() // .JoinAlias(x => x.Weeks, () => week) // .JoinAlias(x => x.Weeks.First().Dosages, () => dosage) // .Fetch(x => ((SupplementCycleDosage)x.Weeks.First().Dosages.First()).Supplement).Eager // .Fetch(x => x.Profile).Eager; // if(param.LegalCriteria==CanBeIllegalCriteria.OnlyLegal) // { // queryCustomer = queryCustomer.Where(x =>!x.CanBeIllegal); // } // else if (param.LegalCriteria == CanBeIllegalCriteria.OnlyIllegal) // { // queryCustomer = queryCustomer.Where(x => x.CanBeIllegal); // } // if (param.Languages.Count > 0) // { // var langOr = Restrictions.Disjunction(); // foreach (var lang in param.Languages) // { // langOr.Add<SupplementCycleDefinition>(x => x.Language == lang); // } // queryCustomer = queryCustomer.And(langOr); // } // if (param.Purposes.Count > 0) // { // var purposeOr = Restrictions.Disjunction(); // foreach (var purpose in param.Purposes) // { // purposeOr.Add<SupplementCycleDefinition>(x => x.Purpose == (WorkoutPlanPurpose)purpose); // } // queryCustomer = queryCustomer.And(purposeOr); // } // if (param.Difficults.Count > 0) // { // var mainOr = Restrictions.Disjunction(); // foreach (TrainingPlanDifficult diff in param.Difficults) // { // var tt = (BodyArchitect.Model.TrainingPlanDifficult)diff; // mainOr.Add<SupplementCycleDefinition>(x => x.Difficult == tt); // } // queryCustomer=queryCustomer.And(mainOr); // } // //if (param.Supplements.Count > 0) // //{ // // if (param.SupplementsListOperator == CriteriaOperator.Or) // // { // // var supplementsOperations = Restrictions.Disjunction(); // // foreach (var supplementId in param.Supplements) // // { // // supplementsOperations.Add<SupplementCycleDefinition>(x => dosage.Supplement.GlobalId == supplementId); // // } // // queryCustomer = queryCustomer.And(supplementsOperations); // // } // // else // // { // // var supplementsOperations = Restrictions.Conjunction(); // // supplementsOperations.Add(Restrictions.On<Suplement>(x => x.GlobalId).IsIn((ICollection)param.Supplements)); // // queryCustomer = queryCustomer.And(supplementsOperations); // // } // //if (param.Supplements.Count > 0) // //{ // // if (param.SupplementsListOperator == CriteriaOperator.Or) // // { // // var supplementsOperations = Restrictions.Disjunction(); // // foreach (var supplementId in param.Supplements) // // { // // supplementsOperations.Add<SupplementCycleDefinition>( // // x => dosage.Supplement.GlobalId == supplementId); // // } // // queryCustomer = queryCustomer.And(supplementsOperations); // // } // // else // // { // // var supplementsOperations = Restrictions.Conjunction(); // // supplementsOperations.Add( // // Restrictions.On<BodyArchitect.Model.Suplement>(x => dosage.Supplement.GlobalId).IsIn( // // (ICollection) param.Supplements)); // // queryCustomer = queryCustomer.And(supplementsOperations); // // } // //} // if (param.Supplements.Count > 0) // { // Junction supplementsOperations = null; // if (param.SupplementsListOperator == CriteriaOperator.Or) // { // supplementsOperations = Restrictions.Disjunction(); // foreach (var supplementId in param.Supplements) // { // supplementsOperations.Add<SupplementCycleDefinition>(x => dosage.Supplement.GlobalId == supplementId); // } // } // else // { // supplementsOperations = Restrictions.Conjunction(); // foreach (var supplementId in param.Supplements) // { // var orderIdsCriteria = DetachedCriteria.For<SupplementCycleDosage>(); // orderIdsCriteria.SetProjection(Projections.CountDistinct("GlobalId")) // .Add(Restrictions.Where<SupplementCycleDosage>(x => x.Supplement.GlobalId == supplementId)) // .Add(Restrictions.Where<SupplementCycleDosage>(x => x.Week.GlobalId == week.GlobalId)); // supplementsOperations.Add(Subqueries.Lt(0, orderIdsCriteria)); // //supplementsOperations.Add<SupplementCycleDosage>(x => dosage.Supplement.GlobalId == supplementId); // } // } // queryCustomer = queryCustomer.And(supplementsOperations); // } // queryCustomer = queryCustomer.Where(x =>x.Profile==loggedProfile || (x.Profile != loggedProfile && x.Status == PublishStatus.Published)); // var groupOr = new Disjunction(); // if (param.SearchGroups.Count > 0) // { // if (param.SearchGroups.IndexOf(WorkoutPlanSearchCriteriaGroup.Mine) > -1) // { // groupOr.Add<BodyArchitect.Model.SupplementCycleDefinition>(x => x.Profile == myProfile); // } // if (param.SearchGroups.IndexOf(WorkoutPlanSearchCriteriaGroup.Favorites) > -1) // { // if (myProfile.FavoriteSupplementCycleDefinitions.Count > 0) // { // groupOr.Add<BodyArchitect.Model.SupplementCycleDefinition>(x => x.GlobalId.IsIn((ICollection)ids)); // } // } // if (param.SearchGroups.IndexOf(WorkoutPlanSearchCriteriaGroup.Other) > -1) // { // var tmpAnd = Restrictions.Conjunction(); // tmpAnd.Add<BodyArchitect.Model.SupplementCycleDefinition>(dto => dto.Profile != null && dto.Profile != myProfile); // if (ids.Count > 0) // { // tmpAnd.Add(Restrictions.On<BodyArchitect.Model.SupplementCycleDefinition>(x => x.GlobalId).Not.IsIn((ICollection)ids)); // } // groupOr.Add(tmpAnd); // } // queryCustomer = queryCustomer.Where(groupOr); // } // queryCustomer=queryCustomer.ApplySorting(param.SortOrder, param.SortAscending); // var res1 = (from rv in Session.Query<RatingUserValue>() // from tp in Session.Query<SupplementCycleDefinition>() // where tp.GlobalId == rv.RatedObjectId && // rv.ProfileId == SecurityInfo.SessionData.Profile.Id // select rv).ToDictionary(t => t.RatedObjectId); // queryCustomer = queryCustomer.TransformUsing(Transformers.DistinctRootEntity); // var listPack = // queryCustomer.ToPagedResults<SupplementCycleDefinitionDTO, SupplementCycleDefinition>(pageInfo, "GlobalId", // delegate(IEnumerable<SupplementCycleDefinition> list) // { // var output = new List<SupplementCycleDefinitionDTO>(); // foreach (var planDto in list) // { // var tmp = planDto.Map<SupplementCycleDefinitionDTO>(); // if (res1.ContainsKey(planDto.GlobalId)) // { // tmp.UserRating = res1[planDto.GlobalId].Rating; // tmp.UserShortComment = res1[planDto.GlobalId].ShortComment; // } // output.Add(tmp); // } // return output.ToArray(); // }); // transactionScope.Commit(); // return listPack; // } // } public SupplementCycleDefinitionDTO SaveSupplementsCycleDefinition(SupplementCycleDefinitionDTO definition) { Log.WriteWarning("SaveSupplementsCycleDefinition:Username={0},GlobalId={1}", SecurityInfo.SessionData.Profile.UserName, definition.GlobalId); if (!SecurityInfo.Licence.IsPremium) { throw new LicenceException("This feature is allowed for Premium account"); } var dbDef = definition.Map <SupplementCycleDefinition>(); using (var transactionScope = Session.BeginSaveTransaction()) { Profile dbProfile = Session.Load <Profile>(SecurityInfo.SessionData.Profile.GlobalId); if (dbDef.IsNew) { dbDef.CreationDate = Configuration.TimerService.UtcNow; } else { var dbGroup = Session.Get <SupplementCycleDefinition>(dbDef.GlobalId); if (dbGroup != null) { if (dbProfile != dbGroup.Profile) { throw new CrossProfileOperationException("Cannot modify Cycle definition for another user"); } if (dbGroup.Status == PublishStatus.Published) { throw new PublishedObjectOperationException("Cannot change published definition"); } } } dbDef.Profile = dbProfile; dbDef.CanBeIllegal = calculateCanBeIllegal(dbDef); dbDef = Session.Merge(dbDef); dbProfile.DataInfo.SupplementsCycleDefinitionHash = Guid.NewGuid(); transactionScope.Commit(); return(dbDef.Map <SupplementCycleDefinitionDTO>()); } }
private SupplementCycleDefinition createCycle() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "Pojedyńczy Trenbolon"; cycleDefinition.Language = "pl"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 10; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = CreateDosageDTO(100, trebolon, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCycle() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "Terapia po cyklu stosowania kuracji testosteronem enantat"; cycleDefinition.Language = "pl"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 1; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = CreateDosageDTO(500, hcg, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Week"; week.CycleWeekStart = 2; week.CycleWeekEnd = 2; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(500, hcg, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(50, clomifen, SupplementCycleDayRepetitions.EveryDay); dosageDto.Comment = "Około 6 dni po ostatniej iniekcji 300 mg Clomifenu, następnie 50 mg dziennie, po tym 40 mg dziennie"; week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Week"; week.CycleWeekStart = 3; week.CycleWeekEnd = 3; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(50, clomifen, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(25, kreatyna, SupplementCycleDayRepetitions.EveryDay, DosageType.Grams); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(40, efedryna, SupplementCycleDayRepetitions.StrengthTrainingDay, timeType: TimeType.BeforeWorkout); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.BeforeWorkout); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.AfterWorkout); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Week"; week.CycleWeekStart = 4; week.CycleWeekEnd = 8; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(50, clomifen, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(10, kreatyna, SupplementCycleDayRepetitions.EveryDay, DosageType.Grams); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(40, efedryna, SupplementCycleDayRepetitions.StrengthTrainingDay, timeType: TimeType.BeforeWorkout); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.BeforeWorkout); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, witaminaC, SupplementCycleDayRepetitions.StrengthTrainingDay, DosageType.Grams, TimeType.AfterWorkout); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Week"; week.CycleWeekStart = 9; week.CycleWeekEnd = 10; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(10, kreatyna, SupplementCycleDayRepetitions.EveryDay, DosageType.Grams); week.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCreatingStormAndShockTherapy_InsreaseServingsEveryWeekDefinition() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "storm and shock therapy"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; cycleDefinition.Weeks.Add(trainingWeek); trainingWeek.CycleWeekStart = 1; trainingWeek.CycleWeekEnd = 1; SupplementCycleDosageDTO dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = shock; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); SupplementCycleWeekDTO nonTrainingWeek = new SupplementCycleWeekDTO(); nonTrainingWeek.Name = "Non training week"; cycleDefinition.Weeks.Add(nonTrainingWeek); nonTrainingWeek.CycleWeekStart = 1; nonTrainingWeek.CycleWeekEnd = 1; dosageDto = new SupplementCycleDosageDTO(); dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; nonTrainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; nonTrainingWeek.Dosages.Add(dosageDto); //week 2 trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; cycleDefinition.Weeks.Add(trainingWeek); trainingWeek.CycleWeekStart = 2; trainingWeek.CycleWeekEnd = 2; dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1.5M; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Supplement = shock; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); nonTrainingWeek = new SupplementCycleWeekDTO(); nonTrainingWeek.CycleWeekStart = 2; nonTrainingWeek.CycleWeekEnd = 2; nonTrainingWeek.Name = "Non training week"; cycleDefinition.Weeks.Add(nonTrainingWeek); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; nonTrainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; nonTrainingWeek.Dosages.Add(dosageDto); //week 3 trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; cycleDefinition.Weeks.Add(trainingWeek); trainingWeek.CycleWeekStart = 3; trainingWeek.CycleWeekEnd = 3; dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Dosage = 2; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = shock; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); nonTrainingWeek = new SupplementCycleWeekDTO(); nonTrainingWeek.CycleWeekStart = 3; nonTrainingWeek.CycleWeekEnd = 3; nonTrainingWeek.Name = "Non training week"; cycleDefinition.Weeks.Add(nonTrainingWeek); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; nonTrainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; nonTrainingWeek.Dosages.Add(dosageDto); //week 4 trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; cycleDefinition.Weeks.Add(trainingWeek); trainingWeek.CycleWeekStart = 4; trainingWeek.CycleWeekEnd = 4; dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 2.5M; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Supplement = shock; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); nonTrainingWeek = new SupplementCycleWeekDTO(); nonTrainingWeek.CycleWeekStart = 4; nonTrainingWeek.CycleWeekEnd = 4; nonTrainingWeek.Name = "Non training week"; cycleDefinition.Weeks.Add(nonTrainingWeek); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; nonTrainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; nonTrainingWeek.Dosages.Add(dosageDto); //week 5 trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; cycleDefinition.Weeks.Add(trainingWeek); trainingWeek.CycleWeekStart = 5; trainingWeek.CycleWeekEnd = 5; dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 3; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = shock; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); nonTrainingWeek = new SupplementCycleWeekDTO(); nonTrainingWeek.CycleWeekStart = 5; nonTrainingWeek.CycleWeekEnd = 5; nonTrainingWeek.Name = "Non training week"; cycleDefinition.Weeks.Add(nonTrainingWeek); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; nonTrainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; nonTrainingWeek.Dosages.Add(dosageDto); //week 6 trainingWeek = new SupplementCycleWeekDTO(); trainingWeek.Name = "Training week"; cycleDefinition.Weeks.Add(trainingWeek); trainingWeek.CycleWeekStart = 6; trainingWeek.CycleWeekEnd = 6; dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.AfterWorkout; trainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Repetitions = SupplementCycleDayRepetitions.StrengthTrainingDay; dosageDto.Dosage = 3.5M; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = shock; dosageDto.TimeType = Service.V2.Model.TimeType.BeforeWorkout; trainingWeek.Dosages.Add(dosageDto); nonTrainingWeek = new SupplementCycleWeekDTO(); nonTrainingWeek.CycleWeekStart = 6; nonTrainingWeek.CycleWeekEnd = 6; nonTrainingWeek.Name = "Non training week"; cycleDefinition.Weeks.Add(nonTrainingWeek); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Supplement = storm; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.TimeType = Service.V2.Model.TimeType.OnEmptyStomach; nonTrainingWeek.Dosages.Add(dosageDto); dosageDto = new SupplementCycleDosageDTO(); dosageDto.Dosage = 1; dosageDto.DosageType = DosageType.Servings; dosageDto.Repetitions = SupplementCycleDayRepetitions.NonTrainingDay; dosageDto.Supplement = storm; dosageDto.TimeType = Service.V2.Model.TimeType.NotSet; nonTrainingWeek.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }
private SupplementCycleDefinition createCycle() { var cycleDefinition = new SupplementCycleDefinitionDTO(); cycleDefinition.Name = "sterydy"; cycleDefinition.Language = "en"; SupplementCycleWeekDTO week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 1; week.CycleWeekEnd = 4; cycleDefinition.Weeks.Add(week); SupplementCycleDosageDTO dosageDto = CreateDosageDTO(400, nandrolon); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(750, testosteron); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(30, metandienon, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 5; week.CycleWeekEnd = 8; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(400, nandrolon); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(750, testosteron); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 9; week.CycleWeekEnd = 12; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(400, nandrolon); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(750, testosteron); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(30, metandienon, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 13; week.CycleWeekEnd = 16; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(400, nandrolon); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(750, testosteron); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 17; week.CycleWeekEnd = 20; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(400, nandrolon); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(750, testosteron); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(30, metandienon, SupplementCycleDayRepetitions.EveryDay); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings); week.Dosages.Add(dosageDto); week = new SupplementCycleWeekDTO(); week.Name = "Training week"; week.CycleWeekStart = 21; week.CycleWeekEnd = 24; cycleDefinition.Weeks.Add(week); dosageDto = CreateDosageDTO(400, nandrolon); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(750, testosteron); week.Dosages.Add(dosageDto); dosageDto = CreateDosageDTO(2, hormon, SupplementCycleDayRepetitions.EveryDay, DosageType.Servings); week.Dosages.Add(dosageDto); var definition = cycleDefinition.Map <SupplementCycleDefinition>(); definition.Profile = profiles[0]; Session.Save(definition); return(definition); }