Example #1
0
        public static IEnumerable <RecipeRecord> GetRecipesForPhase(DietPhase phase)
        {
            List <RecipeType>   r_t = (List <RecipeType>)instance.db.GetItemsWParam <RecipeType>("RecipeType", phase.ToString(), "1");
            List <RecipeRecord> res = new List <RecipeRecord>();

            foreach (RecipeType rt in r_t)
            {
                res.Add(instance.db.GetItem <RecipeRecord>(rt.RecipeID));
            }
            return(res);
        }
Example #2
0
        private void refreshCalendarLabels()
        {
            ScheduleRecord record;
            DietPhase      phase;

            if (!m_phase_dict.TryGetValue(DateTime.Now.Date, out record))
            {
                phase = new DietPhase(DietPhaseId.DP_Default);
            }
            else
            {
                phase = new DietPhase((DietPhaseId)record.m_phase);
            }
            this.CalText2.Text = "Текущая фаза: " + phase.ToString();
            double weight_today, weight_yesterday;

            if (m_phase_dict.TryGetValue(DateTime.Now.Date, out record))
            {
                weight_today = record.m_weight;
            }
            else
            {
                weight_today = 0;
            }
            if (m_phase_dict.TryGetValue(DateTime.Now.Date.AddDays(-1), out record))
            {
                weight_yesterday = record.m_weight;
            }
            else
            {
                weight_yesterday = weight_today;
            }
            double cur_weight_loss = weight_yesterday - weight_today;

            this.CalText3.Text = "Прогресс веса за день: " + cur_weight_loss.ToString() + " кг";
        }
Example #3
0
 public static string GetRuleForStage(DietPhase phase)
 {
     return(DukappRepository.GetRuleForStage(phase));
 }
Example #4
0
 public static string GetRuleForStage(DietPhase phase)
 {
     return(instance.db.GetItemsWParam <RuleRecord>("RuleRecord", "RuleName", phase.GetId().ToString())[0].RuleText.ToString());
 }
Example #5
0
 public static List <RecipeRecord> GetRecipesForPhase(DietPhase phase)
 {
     return((List <RecipeRecord>)DukappCore.DAL.DukappRepository.GetRecipesForPhase(phase));
 }