Пример #1
0
 public void loadQuestion()
 {
     perfect_meal.SetActive(false);
     MealManager.Instance().plateau.gameObject.SetActive(false);
     if (nextQuestion < list.questions.Count)
     {
         if (nextQuestion >= 1)
         {
             back.interactable = true;
         }
         else
         {
             back.interactable = false;
         }
         infos.text = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Text);
         smiley.gameObject.SetActive(false);
         SetChoices();
         ok.gameObject.SetActive(false);
     }
     else
     {
         //charger texte de fin
         infos.text = MealManager.Instance().EndGameMessage;
         loadMenu.SetActive(true);
         MealManager.Instance().AutoEvaluation.SetActive(false);
     }
 }
Пример #2
0
 public void repopulateSource(BasketMealsRecord[] items)
 {
     m_mealDict      = new Dictionary <int, BasketTableItem>();
     m_selectedItems = new List <NSIndexPath>();
     foreach (BasketMealsRecord bmr in items)
     {
         //create new table item
         //BasketTableItem bti = new BasketTableItem();
         // get recipe record for meal
         RecipeMealsRecord rmr = RecipeManager.GetRecipeMealRecord(bmr.RecipeMealsID);
         // record fo each meal id
         BasketTableItem bti;
         string          unit = "";
         m_mealDict.TryGetValue(rmr.MealID, out bti);
         if (bti == null)
         {
             bti = new BasketTableItem();
             MealRecord mr = MealManager.GetMeal(rmr.MealID);
             bti.m_meal_name = mr.Name;
             //save units first
             bti.m_unit = mr.MealDesc;
         }
         bti.m_weight += rmr.Qty;
         bti.m_bmIDs.Add(bmr.ID);
         m_mealDict[rmr.MealID] = bti;
     }
     m_tableItems = new BasketTableItem[m_mealDict.Count];
     m_mealDict.Values.CopyTo(m_tableItems, 0);
 }
Пример #3
0
        public void LoadTest()
        {
            List <Meal> meals = new List <Meal>();

            meals = MealManager.Load();
            Assert.AreEqual(5, meals.Count());
        }
Пример #4
0
        private void viewButton_Click(object sender, EventArgs e)
        {
            // mealListView.Items.Clear();
            MealManager aMealManager = new MealManager();
            int         memberId     = (int)nameComboBox.SelectedValue;

            DateTime input = Convert.ToDateTime(searchTimePicker.Text);
            string   date  = input.Month.ToString();
            List <MemberWithMeal> meals = aMealManager.GetMeals(memberId, date);



            //reportViewer1.ProcessingMode = ProcessingMode.Local;
            ////Providing DataSource for the Report
            //ReportDataSource rds = new ReportDataSource("GetMealReport", meals);
            //reportViewer1.LocalReport.DataSources.Clear();
            //reportViewer1.LocalReport.DataSources.Add(rds);
            //this.reportViewer1.RefreshReport();


            reportViewer1.LocalReport.DataSources.Clear();                                                                                     //clear report
            reportViewer1.LocalReport.ReportEmbeddedResource = "MessManagementSystem.Report.MealReport.rdlc";                                  // bind reportviewer with .rdlc
            Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("GetMealReport", meals); // set the datasource
            reportViewer1.LocalReport.DataSources.Add(dataset);
            dataset.Value = meals;
            //
            reportViewer1.RefreshReport();
        }
Пример #5
0
 private void OnMouseUp()
 {
     if (!MedicalAppManager.Instance().OnMeal)
     {
         //remettre l'ancien
         if (GameObject.Find("SliderModif") && MedicalAppManager.Instance().selectedAliment != null)
         {
             GameObject.Find("SliderModif").GetComponent <SliderModif>().CloseAndKeepOldValues();
         }
         // ajout aliment selectionne dans le manager
         MedicalAppManager.Instance().selectedAliment = gameObject;
         // zone de modification
         AtelierManager.Instance().showModification(true);
     }
     else
     {
         if (MealManager.Instance().MangerPortion != null)
         {
             // affichage manger portion
             MedicalAppManager.Instance().selectedAliment = gameObject;
             MealManager.Instance().updateInfos();
             MealManager.Instance().MangerPortion.SetActive(true);
         }
     }
 }
Пример #6
0
 public ExpenseDetailsController()
 {
     mealManager    = new MealManager();
     expenseManager = new ExpenseManager();
     studentManager = new StudentManager();
     paymentManager = new PaymentManager();
 }
Пример #7
0
 public GenerateBillController()
 {
     mealManager    = new MealManager();
     expenseManager = new ExpenseManager();
     studentManager = new StudentManager();
     paymentManager = new PaymentManager();
 }
Пример #8
0
        public void DeleteTest()
        {
            List <Meal> meals = MealManager.Load();
            Meal        meal  = meals.FirstOrDefault(u => u.Description == "Breakfast");

            int results = MealManager.Delete(meal, true);

            Assert.IsTrue(results > 0);
        }
 public Meal GetOneMeal(int id)
 {
     try
     {
         return(MealManager.GetOneMeal(id));
     }
     catch
     {
         return(new Meal());
     }
 }
 public List <Meal> GetAllMeals()
 {
     try
     {
         return(MealManager.GetAllMeals());
     }
     catch
     {
         return(new List <Meal>());
     }
 }
 public int UpdateExistingMeal(Meal meal)
 {
     try
     {
         return(MealManager.UpdateExistingMeal(meal));
     }
     catch
     {
         return(0);
     }
 }
 public List <MealDisplay> GetMealsToDisplay()
 {
     try
     {
         return(MealManager.GetMealsToDisplay());
     }
     catch
     {
         return(new List <MealDisplay>());
     }
 }
 public int InsertNewMeal(Meal meal)
 {
     try
     {
         return(MealManager.InsertNewMeal(meal));
     }
     catch
     {
         return(0);
     }
 }
Пример #14
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            Console.Title          = "MenuDemo_Matti";

            DataManager dtmngr = new DataManager();

            MealManager mlmngr = new MealManager(dtmngr);



            mlmngr.SuperMainMenu();
        }
Пример #15
0
        double GeTotalMeal()
        {
            MealManager aMealManager = new MealManager();
            List <Meal> meals        = aMealManager.GetMealList();

            double totalMeal = 0;

            foreach (var meal in meals)
            {
                totalMeal = (totalMeal + meal.TotalMeal);
            }
            return(totalMeal);
        }
Пример #16
0
        public void InsertTest()
        {
            List <Meal> meals    = MealManager.Load();
            FoodItem    foodItem = new FoodItem();

            foodItem.Id       = Guid.NewGuid();
            foodItem.FDCId    = 5555555;
            foodItem.MealId   = meals.FirstOrDefault(m => m.Description == "Breakfast").Id;
            foodItem.Quantity = 999;

            int results = FoodItemManager.Insert(foodItem, true);

            Assert.IsTrue(results > 0);
        }
Пример #17
0
    public void EatPortion()
    {
        if (MealManager.Instance().totalPortions <= 30)
        {
            ////gérer animation
            MealManager.Instance().SetMouthAnimation(AnimationTime);

            ////enlever une portion à la selection courante
            MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().nbSlices -= 1;
            MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().SetAlimentQuantity();
            MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().SetAlimentsPositions();
            float temp = MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().al.portions / (float)MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().al.slices;

            MealManager.Instance().totalPortions += temp;
            MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().updateAliments();

            MealManager.Instance().AddEatenAliment();

            if ((MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().al.greasy ||
                 MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().al.sugary) &&
                MedicalAppManager.Instance().userOperation == Operation.by_pass)
            {
                MealManager.Instance().SetDumpingSyndrom(true);
                MealManager.Instance().EndMeal();
            }


            ////mettre à jour meal
            //if (!_MGR_MedicalApp.instance.repas.listAliments.Exists(u => u == _MGR_MedicalApp.instance.selectedAliment.GetComponent<BlocAliment>()))
            //    _MGR_MedicalApp.instance.repas.listAliments.Add(_MGR_MedicalApp.instance.selectedAliment.GetComponent<BlocAliment>());
            //_MGR_MedicalApp.instance.repas.totalPortions += 1;

            ////si il n'y a plus rien, passer au plat suivant
            if (MedicalAppManager.Instance().selectedAliment.GetComponent <PlateBlocAliment>().nbSlices == 0)
            {
                MealManager.Instance().MangerPortion.SetActive(false);
                DestroyImmediate(MedicalAppManager.Instance().selectedAliment);
            }
            MealManager.Instance().updateInfos();
        }
        else
        {
            MealManager.Instance().SetDumpingSyndrom(true);
            MealManager.Instance().DumpingToggle.SetActive(true);
            MealManager.Instance().EndMeal();
            MedicalAppManager.Instance().PortionsMax = true;
        }
    }
Пример #18
0
    void Awake()
    {
        //Check if instance already exists
        if (_instance == null)
        {
            //if not, set instance to this
            _instance = this;
        }

        //If instance already exists and it's not this:
        else if (_instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }
    }
Пример #19
0
        public void ShowMemberInformation(int memberId, String date)
        {
            MealManager           aMealManager   = new MealManager();
            List <MemberWithMeal> mealList       = aMealManager.GetMeals(memberId, date);
            MemberManager         aMemberManager = new MemberManager();
            MemberGateway         aGateway       = new MemberGateway();
            Member member = aGateway.GetMemberById(memberId);

            // CrystalReport crystalReport=new CrystalReport();
            MealCrystalReport mealCrystal = new MealCrystalReport();

            mealCrystal.SetDataSource(mealList);
            mealCrystal.SetParameterValue("mName", member.MemberName.ToString());
            mealCrystal.SetParameterValue("mPhone", member.Phone.ToString());
            mealCrystal.SetParameterValue("date", DateTime.Today);
            mealCrystalReportViewer.ReportSource = mealCrystal;
        }
Пример #20
0
        public void InsertTest()
        {
            List <User> users     = UserManager.Load();
            List <Food> foodItems = FoodItemManager.Load();

            Meal meal = new Meal();

            meal.Id          = Guid.NewGuid();
            meal.UserId      = users.FirstOrDefault(u => u.FullName == "Leroy Jenkins").Id;
            meal.Description = "Breakfast";
            meal.Time        = DateTime.Now;
            meal.FoodItems   = foodItems;

            int results = MealManager.Insert(meal, true);

            Assert.IsTrue(results > 0);
        }
Пример #21
0
 // Update is called once per frame
 void Update()
 {
     if (isActive)
     {
         if (time > 0f)
         {
             img_timer.fillAmount = time / timeAmount;
             timeText.text        = (time * multiplier).ToString("F");
             time -= Time.deltaTime;
         }
         else
         {
             time                 = 0f;
             timeText.text        = 0.0.ToString("F");
             img_timer.fillAmount = 0;
             isActive             = false;
             MealManager.Instance().TimerUI.SetActive(false);
         }
     }
 }
Пример #22
0
        private void LoadDailyMal()
        {
            MealManager aMealManager = new MealManager();

            string month = DateTime.Now.Month.ToString();

            ShopingManager shopingManager = new ShopingManager();

            List <MemberWithShoping> shopingList = shopingManager.GetShopingList(month);

            dailyShopingReportViewer.LocalReport.DataSources.Clear();                           //clear report
            dailyShopingReportViewer.LocalReport.ReportEmbeddedResource =
                "MessManagementSystem.Report.DailyShopingReport.rdlc";                          // bind reportviewer with .rdlc
            Microsoft.Reporting.WinForms.ReportDataSource dataset =
                new Microsoft.Reporting.WinForms.ReportDataSource("DailyShoping", shopingList); // set the datasource
            dailyShopingReportViewer.LocalReport.DataSources.Add(dataset);
            dataset.Value = shopingList;
            //
            dailyShopingReportViewer.RefreshReport();
        }
Пример #23
0
 public MealTableSrc(RecipeMealsRecord[] items)
 {
     m_tableItems = new List <MealTableItem>();
     if (items.Length != 0)
     {
         m_recipeID = items[0].RecipeID;
         foreach (RecipeMealsRecord rmr in items)
         {
             MealRecord        meal = MealManager.GetMeal(rmr.MealID);
             BasketMealsRecord bmr  = BasketManager.GetBasketRecipeRecord(rmr.ID);
             if (meal != null)
             {
                 MealTableItem mti = new MealTableItem();
                 mti.m_meal      = meal;
                 mti.m_qty       = rmr.Qty;
                 mti.m_bInBasket = bmr == null ? false : true;
                 mti.m_RecMealID = rmr.ID;
                 m_tableItems.Add(mti);
             }
         }
     }
 }
Пример #24
0
 private void OnMouseUp()
 {
     // ajout aliment selectionne dans le manager
     MedicalAppManager.Instance().selectedAliment = gameObject;
     if (OnPlate)
     {
         // zone de modification
         AtelierManager.Instance().showModification(true);
     }
     else if (OnMeal)
     {
         if (MealManager.Instance().MangerPortion != null)
         {
             // affichage manger portion
             MealManager.Instance().MangerPortion.SetActive(true);
         }
     }
     else if (OnAtelier)
     {
         // zone de validation
         AtelierManager.Instance().showValidation(true);
         //Camera.main.GetComponent<MouseLook>().setCameraFree(false);
     }
 }
Пример #25
0
        private void viewButton_Click(object sender, EventArgs e)
        {
            mealListView.Items.Clear();
            MealManager aMealManager = new MealManager();
            int         memberId     = (int)nameComboBox.SelectedValue;

            string date = DateTime.Now.Month.ToString();
            List <MemberWithMeal> meals = aMealManager.GetMeals(memberId, date);


            double subtotal = 0;
            int    count    = 1;

            foreach (var meal in meals)
            {
                subtotal = subtotal + meal.TotalMeal;
                ListViewItem item = new ListViewItem();
                item.Text = count++.ToString();
                item.SubItems.Add(meal.Date.ToString());
                item.SubItems.Add(meal.TotalMeal.ToString());
                item.SubItems.Add(subtotal.ToString());
                mealListView.Items.Add(item);
            }
        }
Пример #26
0
    public void userChoice(int choice)
    {
        choice_save.Add(choice);
        back.interactable = true;
        ClearChoices();
        //réponse (list.questions[nextQuestion].Answer)
        //image (couleur smiley dépendante d'un switch et des données du repas)
        smiley.gameObject.SetActive(true);
        switch (nextQuestion)
        {
        case 0:
            int           result    = 2;
            List <string> mealtypes = MealManager.Instance().getMealTypes();
            if (mealtypes.Count < 3)
            {
                result -= 1;
            }
            if (!mealtypes.Contains("plat principal"))
            {
                result -= 1;
            }

            if (result == 0)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyRouge");
            }
            else if (result == 1)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyOrange");
            }
            else if (result == 2)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyVert");
            }

            Debug.Log(choice + " " + result);
            Debug.Log(list.questions[nextQuestion].Answers.Count);

            infos.text = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 3 + result]);

            perfect_meal.SetActive(true);

            MealManager.Instance().plateau.gameObject.SetActive(true);
            MealManager.Instance().plateau.transform.localScale = Vector3.one * 2.7f;
            MealManager.Instance().plateau.transform.localPosition = new Vector3(0.0f, -0.28f, 1.0f);
            MealManager.Instance().plateau.Clear();
            MealManager.Instance().loadAllAlimentsFromList(MealManager.Instance().EatenAliments);
            MealManager.Instance().plateau.CanInteractWithAliments(false);



            break;

        case 1:
            //couleurs en fonction du nombre de plats ( < 4 --> rouge / =4 --> orange / >= 5 --> vert ==> si nombres portions incorrectes --> orange)
            int nbAliments = MealManager.Instance().EatenAliments.Count;
            if (nbAliments >= 5)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyVert");
                infos.text    = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 3 + 2]);
            }
            else if (nbAliments == 4)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyOrange");
                infos.text    = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 3 + 1]);
            }
            else
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyRouge");
                infos.text    = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 3 + 0]);
            }
            break;

        case 2:
            //couleurs en fonction du nombre de portions (rouge si < à 20 ou > à 40  orange si entre 20 et 25 et entre 35 et 40 vert  si entre 26 et 34)
            float nbPortions = MealManager.Instance().totalPortions;
            if (nbPortions >= 26 && nbPortions <= 34)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyVert");
                infos.text    = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 5 + 2]);
            }
            else if (nbPortions >= 20 && nbPortions <= 40)
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyOrange");
                if (nbPortions < 26)
                {
                    infos.text = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 5 + 1]);
                }
                else
                {
                    infos.text = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 5 + 3]);
                }
            }
            else
            {
                smiley.sprite = Resources.Load <Sprite>("UI/Image/SmileyRouge");
                if (nbPortions < 20)
                {
                    infos.text = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 5 + 0]);
                }
                else
                {
                    infos.text = MedicalAppManager.Instance().setUserDataInText(list.questions[nextQuestion].Answers[choice * 5 + 4]);
                }
            }
            break;
        }
        //bouton "OK" (charge load next question)
        ok.gameObject.SetActive(true);
    }
Пример #27
0
 // PUT api/values/5
 public int Put(int id, [FromBody] Meal value)
 {
     return(MealManager.Update(value));
 }
Пример #28
0
 // DELETE api/values/5
 public int Delete([FromBody] Meal value)
 {
     return(MealManager.Delete(value));
 }
Пример #29
0
 public App()
 {
     MealManager = new MealManager(DependencyService.Get<IDataLayer>());
     MainPage = new NavigationPage(new HomeView());
 }
Пример #30
0
 public void CloseValidation()
 {
     MealManager.Instance().MangerPortion.SetActive(false);
     MedicalAppManager.Instance().selectedAliment = null;
     MealManager.Instance().updateInfos();
 }
Пример #31
0
 void Start()
 {
     Instance = this;
 }