Пример #1
0
 public override string ToString()
 {
     return
         ($"\nProteins  {Proteins.ToString("0.##")} g = {(Proteins * 4).ToString("0.##")} Kcal" +
          $"\nFat       {Fat.ToString("0.##")} g = {(Fat * 9).ToString("0.##")} Kcal" +
          $"\nCarbs     {Carbs.ToString("0.##")} g = {(Carbs * 4).ToString("0.##")} Kcal" +
          $"\nTotalgram {TotalGrams.ToString("0.##")} g = {Kcal.ToString("0.##")} Kcal");
 }
Пример #2
0
        public string ToInsert()
        {
            var kcal    = Kcal.ToString().Replace(',', '.');
            var protein = Protein.ToString().Replace(',', '.');
            var fat     = Fat.ToString().Replace(',', '.');
            var carbs   = Carbs.ToString().Replace(',', '.');

            return($"('{ID}', '{Name}', '{kcal}', '{protein}', '{fat}', '{carbs}', '{Type}')");
        }
Пример #3
0
        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));
        }