public static adjunctAddition updateAdjunctAddition(adjunctAddition oldAddition, adjunctAddition newAddition) { oldAddition.amount = newAddition.amount; oldAddition.time = newAddition.time; oldAddition.timeUnit = newAddition.timeUnit; oldAddition.type = newAddition.type; oldAddition.unit = newAddition.unit; return(oldAddition); }
public static adjunctAddition makeEmptyAdjunctAddition() { adjunctAddition e = new adjunctAddition(); e.additionGuid = Guid.NewGuid().ToString(); e.adjunct = new adjunct(); e.adjunct.name = ""; e.adjunct.idString = ""; e.adjunctID = ""; e.amount = 0; e.time = 0; e.timeUnit = ""; e.type = ""; e.unit = ""; return(e); }
public void AddAdjunct() { adjunctAddition aa = RecipeTools.makeEmptyAdjunctAddition();//new adjunctAddition(); //adjunct adjunct = new adjunct(); //aa.adjunct = adjunct; adjunctState.currentSelectedAdjunctID = ""; if (Model.adjuncts.Count > 0) { Model.adjuncts.Insert(adjunctState.currentSelectedAdjunctIndex + 1, aa); adjunctState.currentSelectedAdjunctIndex++; } else { Model.adjuncts.Add(aa); adjunctState.currentSelectedAdjunctIndex = 0; } Save(false); }
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); }