public override string ToString() { string stickValue = Stick ? "0" : string.Empty; string sugarValue = Sugar > 0 ? Sugar.ToString() : string.Empty; return($"{Type}:{sugarValue}:{stickValue}"); }
public string toClientData() { return(string.Format("\"{0}\",{1},{2},{3},\"{4}\",{5},{6},{7},{8},{9},{10},{11},{12},{13}, \"{14}\"", Name, Id, (Category)? 1 : 0, Price.ToString("0.00", CultureInfo.InvariantCulture), Composition, EnergyKj, EnergyKcal, Protein.ToString("0.00", CultureInfo.InvariantCulture), Carbohydrates.ToString("0.00", CultureInfo.InvariantCulture), Sugar.ToString("0.00", CultureInfo.InvariantCulture), TotalFat.ToString("0.00", CultureInfo.InvariantCulture), SaturatedFat.ToString("0.00", CultureInfo.InvariantCulture), Fiber.ToString("0.00", CultureInfo.InvariantCulture), Salt.ToString("0.00", CultureInfo.InvariantCulture), Path)); }
public void Run() { var coffee = new Coffee(); _output.WriteLine(coffee.ToString()); var sugar = new Sugar(coffee,2); _output.WriteLine(sugar.ToString()); var cream = new Cream(sugar,1); _output.WriteLine(cream.ToString()); }
public override string ToString() { string str = ""; str += "&idserver=\"" + IDServer.ToString() + "\""; if (IDUnit != -1) { str += "&idunit=\"" + IDUnit.ToString() + "\""; } if (IDServerMeal != -1) { str += "&idmeal=\"" + IDServerMeal.ToString() + "\""; } if (IDUser != 0) { str += "&iduser=\"" + IDUser.ToString() + "\""; } if (Calories != -1) { str += "&calories=\"" + Calories.ToString() + "\""; } if (Protein != -1) { str += "&protein=\"" + Protein.ToString() + "\""; } if (Carb != -1) { str += "&carb=\"" + Carb.ToString() + "\""; } if (Fat != -1) { str += "&fat=\"" + Fat.ToString() + "\""; } if (SatFat != -1) { str += "&satfat=\"" + SatFat.ToString() + "\""; } if (UnSatFat != -1) { str += "&unsatfat=\"" + UnSatFat.ToString() + "\""; } if (Cholesterol != -1) { str += "&cholesterol=\"" + Cholesterol.ToString() + "\""; } if (Sugar != -1) { str += "&sugar=\"" + Sugar.ToString() + "\""; } if (Natrium != -1) { str += "&natrium=\"" + Natrium.ToString() + "\""; } if (Potassium != -1) { str += "&potassium=\"" + Potassium.ToString() + "\""; } if (Fiber != -1) { str += "&fiber=\"" + Fiber.ToString() + "\""; } if (Deleted != -1) { str += "&deleted=\"" + Deleted.ToString() + "\""; } if (InsertDate != null) { str += "&insertdate=\"" + InsertDate.ToString("yyyy-MM-dd HH:mm:ss") + "\""; } if (UpdateDate != null) { str += "&updatedate=\"" + UpdateDate.ToString("yyyy-MM-dd HH:mm:ss") + "\""; } return(str.Substring(1)); }
public string StringInfo() { return("Caramel: " + Caramel.ToString() + "\nChesse: " + Chesse.ToString() + "\nBacon: " + Bacon.ToString() + "\nSalted: " + Salt.ToString() + "\nSugar: " + Sugar.ToString() + "\nChocolate: " + Chocolate.ToString()); }