示例#1
0
 private void DebugButton_Click(object sender, EventArgs e)
 {
     /*notifywindow = new NotificationWindow();
      * notifywindow.delay = Convert.ToInt16(settingwindow.notifydelay);
      * notifywindow.Show();*/
     MessageBox.Show(GetMeniny.MeninyDate("Alexandra").ToString());
 }
示例#2
0
        public EditBirthdayDialog()
        {
            InitializeComponent();

            string           path         = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Calendar\data.db";
            SQLiteConnection dbConnection = new SQLiteConnection("Data Source=" + path + ";Version=3;");

            dbConnection.Open();
            if (type == "Birthdays")
            {
                SQLiteCommand comm_birthdays = new SQLiteCommand("SELECT name,birthday FROM birthdays", dbConnection);
                using (SQLiteDataReader read = comm_birthdays.ExecuteReader())
                {
                    while (read.Read())
                    {
                        EditingDialog_DataView.Rows.Add(new object[] {
                            read.GetValue(read.GetOrdinal("name")),
                            //read.GetValue(read.GetOrdinal("birthday")),
                            Convert.ToDateTime(read.GetValue(read.GetOrdinal("birthday"))).ToString("d. M. yyyy"),
                            "Odstranit"
                        });
                    }
                }
            }
            else if (type == "Meniny")
            {
                birthday.HeaderText = "Meniny";
                SQLiteCommand comm_meniny = new SQLiteCommand("SELECT name FROM meniny", dbConnection);
                using (SQLiteDataReader read = comm_meniny.ExecuteReader())
                {
                    while (read.Read())
                    {
                        EditingDialog_DataView.Rows.Add(new object[] {
                            read.GetValue(read.GetOrdinal("name")),
                            //read.GetValue(read.GetOrdinal("birthday")),
                            GetMeniny.MeninyDate(read.GetValue(read.GetOrdinal("name")).ToString()).ToString("d. M."),
                            //Convert.ToDateTime(read.GetValue(read.GetOrdinal("birthday"))).ToString("d. M. yyyy"),
                            "Nuke this shit!"
                        });
                    }
                }
            }
            else
            {
                EditingDialog_DataView.Rows.Add(new object[] {
                    "Něco se stalo :("
                });
                birthday.Visible             = false;
                EditingDialog_Delete.Visible = false;
            }
        }