コード例 #1
0
        // database current day calendar import.
        public void calendarListRefresh()
        {
            dbConnect.Open();
            listView_Schedule.Items.Clear();

            dbCommand = new SQLiteCommand(QueryList.listviewRefreshSQL(selectYear, selectMonth, selectDay), dbConnect);
            SQLiteDataReader reader = dbCommand.ExecuteReader();

            while (reader.Read())
            {
                bool active = (bool)reader["active"];

                listView_Schedule.Items.Add(new ListViewItem(new string[] {
                    ((int)reader["sethour"]).ToString("00") + " : " + ((int)reader["setminute"]).ToString("00"),
                    reader["text"].ToString(),
                    active ? "Y" : "N"
                }));
            }

            reader.Close();
            dbConnect.Close();

            button_modifySch.Enabled = false;
            button_deleteSch.Enabled = false;

            dataview.refreshData();
        }