private string TotalReal(MixingInfo real) { double realTotal = 0; realTotal = real.ChemicalA.ToDouble() + real.ChemicalB.ToDouble() + real.ChemicalC.ToDouble() + real.ChemicalD.ToDouble() + real.ChemicalE.ToDouble(); return(realTotal.ToString()); }
public static DateTime ExpriedTime(this MixingInfo mixing) { if (mixing.Glue.GlueIngredients.Count == 0) { return(DateTime.MinValue); } if (mixing.Glue.GlueIngredients.FirstOrDefault(a => a.Position == "A") == null) { return(DateTime.MinValue); } var ingredient = mixing.Glue.GlueIngredients.FirstOrDefault(a => a.Position == "A").Ingredient; if (ingredient.ExpiredTime == 600) { return(DateTime.MinValue); } else { if (ingredient.CreatedDate.IsNullOrEmpty()) { return(DateTime.MinValue); } var createdTime = mixing.CreatedTime; return(createdTime.AddMinutes(ingredient.ExpiredTime)); } }
double CalculateGlueTotal(MixingInfo mixingInfo) { return(mixingInfo.ChemicalA.ToDouble() + mixingInfo.ChemicalB.ToDouble() + mixingInfo.ChemicalC.ToDouble() + mixingInfo.ChemicalD.ToDouble() + mixingInfo.ChemicalE.ToDouble()); }