예제 #1
0
 private void Button2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow.Index != -1)
     {
         Medicine m = new Medicine();
         m.Prescribe_Id = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value);
         m.deletePrescription();
         Prescribe_Medicine mp = new Prescribe_Medicine(pid);
         this.Close();
         mp.Show();
     }
 }
예제 #2
0
 private void Button2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow.Index != -1)
     {
         Prescribe_Medicine sp = new Prescribe_Medicine(Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value));
         this.Hide();
         sp.Show();
     }
     else
     {
         MessageBox.Show("Select Any Patient to Proceed.");
     }
 }
예제 #3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Medicine m = new Medicine();

            m.Name   = comboBox1.Text.ToString();
            m.Time   = comboBox2.Text.ToString();
            m.Days   = Convert.ToInt32(textBox1.Text.ToString());
            m.Remark = textBox2.Text.ToString();
            if (checkedListBox1.GetItemChecked(0))
            {
                m.Morning = "Yes";
            }
            else
            {
                m.Morning = "No";
            }
            if (checkedListBox1.GetItemChecked(1))
            {
                m.Afternoon = "Yes";
            }
            else
            {
                m.Afternoon = "No";
            }
            if (checkedListBox1.GetItemChecked(2))
            {
                m.Evening = "Yes";
            }
            else
            {
                m.Evening = "No";
            }
            if (checkedListBox1.GetItemChecked(3))
            {
                m.Night = "Yes";
            }
            else
            {
                m.Night = "No";
            }
            m.P_Id = pid;
            m.addPrescription();
            Prescribe_Medicine pm = new Prescribe_Medicine(pid);

            this.Close();
            pm.Show();
        }