コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItems.Count > 1 || listBox1.SelectedItems.Count == 0)
            {
                return;
            }
            db.Write("DELETE FROM psychiatric.dbo.reservations WHERE CustName = N'" + listBox1.SelectedItem.ToString() + "' AND Day = N'" + day + "' AND Hour = N'" + hour + "'");
            MessageBox.Show("تم المسح بنجاح", "Success");
            listBox1.Items.Remove(listBox1.SelectedItem);

            String window = Application.OpenForms[1].ToString();

            if (window == "Psychiatric.showWeeklyschedule, Text: showWeeklyschedule")
            {
                showWeeklyschedule obj = (showWeeklyschedule)Application.OpenForms["showWeeklyschedule"];
                obj.init();
            }
            else if (window == "Psychiatric.showDailySchedule, Text: showDailySchedule")
            {
                showDailySchedule obj = (showDailySchedule)Application.OpenForms["showDailySchedule"];
                obj.init();
            }
            Close();
        }
コード例 #2
0
        private void button11_Click(object sender, EventArgs e)
        {
            showWeeklyschedule show = new showWeeklyschedule();

            OpenForm(show);
        }