Beispiel #1
0
        public IActionResult Get(string id)
        {
            DataAccess accessor      = new DataAccess();
            adjunct    currentRecipe = accessor.Get <adjunct>(id);

            return(Json(currentRecipe));
        }
Beispiel #2
0
        public IActionResult Post([FromBody] adjunct value, string id)
        {
            //double ibu = MathFunctions.IBU.basicIBU(value, 1.07);

            DataAccess accessor = new DataAccess();

            value = GlobalFunctions.AddIdIfNeeded(value, id);

            return(Json(accessor.Post(value)));
        }
Beispiel #3
0
 public string findAdjunctIDFromSelecteAdjunct()
 {
     resetSelector();
     if (adjunctState.currentSelectedAdjunctIndex != -1 && Model.adjuncts.Count != 0)
     {
         adjunct currentSelection = AllAdjuncts.Where(x => x.name == Model.adjuncts[adjunctState.currentSelectedAdjunctIndex].adjunct.name).FirstOrDefault();
         if (currentSelection == null)
         {
             return "-1";
         }
         else
         {
             return currentSelection.idString;
         }
     }
     else
     {
         return "-1";
     }
 }
Beispiel #4
0
        public List <adjunctAddition> mapAdjuntAdditions(List <miscObj> Miscs)
        {
            List <adjunctAddition> adjunctAdditions = new List <adjunctAddition>();

            foreach (miscObj o in Miscs)
            {
                adjunct aj = new adjunct();
                aj.name = o.NAME;
                //o.NOTES;

                adjunctAddition adj = new adjunctAddition();
                adj.additionGuid = Guid.NewGuid().ToString();
                adj.adjunct      = aj;
                adj.amount       = Math.Round(o.AMOUNT.Value * KGtoOZ, 2); //amount is in kg
                adj.unit         = "oz";                                   //thats what we're converting it to....
                adj.type         = o.USE;
                adj.time         = (float)o.TIME;                          //TIME is in minutes, I think that should be fine...
                adjunctAdditions.Add(adj);
            }
            return(adjunctAdditions);
        }