private void Session_List_FormClosing(object sender, FormClosingEventArgs e) { Patient_Med_History jo = new Patient_Med_History(Patient_ID_SesLabel.Text, Patient_Name_SesLabel.Text); this.Hide(); jo.Show(); }
private void Extra_Med_Register_Button_Click(object sender, EventArgs e) { if (clear2.Contains(Extra_Med_Box.Text)) { MessageBox.Show("This medication is already being used by the patient"); } else { if (checkconf() == true) { MessageBox.Show("The suggested medication is in conflict with another medication, check the medication conflict table"); } if (checkconf() == false) { picko = Convert.ToDateTime(ok.ToString()); yearstr = picko.Year.ToString(); if (Specific_MedCheck.Checked == true) { actualdate = yearstr + "-" + Extra_Med_Month.Text + "-" + Extra_Med_Day.Text; actd = Convert.ToDateTime(actualdate); } if (Today_MedCheck.Checked == true) { actd = DateTime.Now; } excon.Open(); actid = Convert.ToInt32(Ex_Med_ID.Text); double jo = Convert.ToDouble(New_MedAmount.Text); string ho2 = "INSERT INTO Patient_Medication_Historty(ID, Name, Medication, Starting_Date, End_Date, Amount_Used)"; ho2 += "VALUES (@ID, @Name, @Medication, @Starting_Date, @End_Date, @Amount_Used)"; SqlCommand excom = new SqlCommand(ho2, excon); //exdat = Extra_Med_Year.Text + "-" + Extra_Med_Month.Text + "-" + Extra_Med_Day.Text; excom.Parameters.AddWithValue("Name", Ex_Med_Name.Text); excom.Parameters.AddWithValue("ID", actid); excom.Parameters.AddWithValue("Medication", Extra_Med_Box.Text); excom.Parameters.AddWithValue("Starting_Date", actd); excom.Parameters.AddWithValue("End_Date", DBNull.Value); excom.Parameters.AddWithValue("Amount_Used", jo); excom.ExecuteNonQuery(); MessageBox.Show("Medication Registered"); this.Hide(); Patient_Med_History gobak = new Patient_Med_History(Ex_Med_ID.Text, Ex_Med_Name.Text); gobak.Show(); excon.Close(); } } }
private void Patients_ID_View_CellContentClick(object sender, DataGridViewCellEventArgs e) { selectedrownindex = e.RowIndex; DataGridViewRow row = new DataGridViewRow(); row = Patients_ID_View.Rows[selectedrownindex]; if (e.ColumnIndex == 0) { if (!(row.Cells[2].Value == DBNull.Value || row.Cells[2].Value == null || String.IsNullOrWhiteSpace(row.Cells[2].Value.ToString()))) { g = row.Cells[6].Value; g2 = row.Cells[2].Value; pasd = Convert.ToString(g); pasd2 = Convert.ToString(g2); this.Hide(); Patient_Med_History mef = new Patient_Med_History(pasd, pasd2); mef.Show(); } else { } } if (e.ColumnIndex == 1) { if (!(row.Cells[2].Value == DBNull.Value || row.Cells[2].Value == null || String.IsNullOrWhiteSpace(row.Cells[2].Value.ToString()))) { g = row.Cells[6].Value; g2 = row.Cells[2].Value; pasd = Convert.ToString(g); pasd2 = Convert.ToString(g2); Patient_Double_Med_History jok = new Patient_Double_Med_History(pasd, pasd2); this.Hide(); jok.Show(); } } }