Ejemplo n.º 1
0
        public OnegaiModel(
            uint id,
            string title,
            string detail,
            string Author,
            string onegaiCondition,
            string onegaiConditionArg,
            long satisfaction,
            bool isInitialLock,
            ScheduleModel scheduleModel
            )
        {
            this.Id     = id;
            this.Title  = title;
            this.Detail = detail;
            this.Author = Author;

            this.OnegaiCondition = OnegaiCondition.None;
            if (Enum.TryParse(onegaiCondition, out OnegaiCondition outOnegaiCondition))
            {
                this.OnegaiCondition = outOnegaiCondition;
            }

            this.OnegaiConditionArg = new OnegaiConditionArg(onegaiConditionArg);
            this.Satisfaction       = new Satisfaction(satisfaction);
            this.IsInitialLock      = isInitialLock;
            this.ScheduleModel      = scheduleModel;
        }
Ejemplo n.º 2
0
        private OnegaiModel CreateOnegaiModel(OnegaiEntry entry)
        {
            ScheduleModel scheduleModel = null;

            if (entry.IsSchedule)
            {
                scheduleModel = scheduleRepository.Get(entry.ScheduleId);
                Debug.Assert(scheduleModel != null, "ScheduleModel がありません。");
            }

            return(new OnegaiModel(
                       entry.Id,
                       entry.Title,
                       entry.Detail,
                       entry.Author,
                       entry.OnegaiCondition,
                       entry.OnegaiConditionArg,
                       entry.Satisfaction,
                       entry.IsInitialLock,
                       scheduleModel));
        }