Esempio n. 1
0
        A6WTrainingDTO startCycle(MyTrainingOperationType operation)
        {
            var cycle = new A6WTrainingDTO();

            cycle.RemindBefore = RemindBefore;
            var param = new MyTrainingOperationParam();

            param.Operation  = operation;
            param.MyTraining = cycle;
            cycle.Name       = Name;
            if (Customer != null)
            {
                cycle.CustomerId = Customer.GlobalId;
            }
            cycle.StartDate = StartDate.ToUniversalTime();
            return((A6WTrainingDTO)ServiceManager.MyTrainingOperation(param));
        }
        SupplementsCycleDTO startCycle(MyTrainingOperationType operation)
        {
            var cycle = new SupplementsCycleDTO();

            cycle.RemindBefore = RemindBefore;
            var param = new MyTrainingOperationParam();

            param.Operation  = operation;
            param.MyTraining = cycle;
            if (Customer != null)
            {
                cycle.CustomerId = Customer.GlobalId;
            }
            cycle.TrainingDays = getTrainingDays();
            cycle.TotalWeeks   = TotalWeeks;
            cycle.SupplementsCycleDefinitionId = CycleDefinition.GlobalId;
            cycle.Name      = CycleDefinition.Name;//TODO:user should allow change this name
            cycle.StartDate = StartDate.ToUniversalTime();
            cycle.Weight    = ((double?)Weight).ToSaveWeight();
            return((SupplementsCycleDTO)ServiceManager.MyTrainingOperation(param));
        }