using System.Collections.Generic;
static List<Weather> weatherList = new List<Weather>();
static DataFoot dataFoot = new DataFoot();
static DateTime CurrentDateTime { get; set; }
public static void Main()
choose = Int32.Parse(Console.ReadLine());
Console.WriteLine("Thiết lập thời gian hệ thống (dd/MM/yyyy HH:mm:ss): ");
string dateStr = Console.ReadLine();
CurrentDateTime = DateTime.ParseExact(dateStr, "dd/MM/yyyy HH:mm:ss",
System.Globalization.CultureInfo.InvariantCulture);
Console.WriteLine("Thời gian hiện tại: {0}", CurrentDateTime.ToString("dd/MM/yyyy HH:mm:ss"));
Console.WriteLine("Thoát!!!");
Console.WriteLine("Nhập sai!!!");
Random random = new Random();
int count = random.Next(500);
Console.WriteLine("Steps: {0}", count);
static void ShowWeatherToDay()
string currentDateTimeStr = CurrentDateTime.ToString("dd/MM/yyyy");
for (int i = 0; i < weatherList.Count; i++)
string myDateTimeStr = weatherList[i].MyDateTime.ToString("dd/MM/yyyy");
if (currentDateTimeStr.Equals(myDateTimeStr))
weatherList[i].Display();
static void ShowWeatherInWeek()
for (int i = 0; i < weatherList.Count && count <= 7; i++)
if (weatherList[i].MyDateTime.CompareTo(CurrentDateTime) >= 0)
weatherList[i].Display();
for (int i = 1; i <= 9; i++)
string dateStr = "0" + i + "/06/2021 14:30:00";
string status = "Ngày " + i;
Weather weather = new Weather(dateStr, status);
weatherList.Add(weather);
CurrentDateTime = DateTime.Now;
Console.WriteLine("\nCHƯƠNG TRÌNH QUẢN LÝ SỨC KHỎE C#");
Console.WriteLine("*********************************MENU************************************");
Console.WriteLine("** 1. Thời tiết 7 ngày sau **");
Console.WriteLine("** 2. Thời tiết hôm nay **");
Console.WriteLine("** 3. Đếm số bước chân **");
Console.WriteLine("** 4. Thông tin sức khỏe **");
Console.WriteLine("** 5. Thiết lập thời gian hệ thống **");
Console.WriteLine("** 6. Xem thời gian hiện tại **");
Console.WriteLine("** 7. Thoát. **");
Console.WriteLine("** Chọn: **");
Console.WriteLine("*************************************************************************");
public DateTime MyDateTime { get; set; }
public string Status { get; set; }
public Weather(DateTime dateTime, string status)
this.MyDateTime = dateTime;
public Weather(string dateStr, string status)
this.MyDateTime = ToDateTimeFromString(dateStr);
Console.WriteLine("DateTime: {0}, Status: {1}", ToStringFromDateTime(), Status);
public string ToStringFromDateTime()
string date_str = MyDateTime.ToString("dd/MM/yyyy HH:mm:ss");
public DateTime ToDateTimeFromString(string dateStr)
DateTime myDate = DateTime.ParseExact(dateStr, "dd/MM/yyyy HH:mm:ss",
System.Globalization.CultureInfo.InvariantCulture);
public int Count { get; set; }
public string Level { get; set; }
Level = GetStringLevel();
public void AddStep(int steps)
Level = GetStringLevel();
Console.WriteLine("Thông tin sức khỏe: Steps = {0}, Level = {1}", Count, Level);
public string GetStringLevel()
int[] countList = { 0, 1000, 5000, 10000 };
string[] levelNames = { "INACTIVE", "SMALL", "NORMAL", "GOOD" };
for (int i = 0; i < countList.Length; i++)
if (Count <= countList[i])