private void InsertVerordnungenToBehandlung(Behandlung behandlung) { using (SqlConnection connection = base.GetSqlConnection()) { connection.Open(); var cmd = new SqlCommand { Connection = connection, CommandText = "SELECT * FROM prescription, recpie WHERE prescription.treatment_id = @val" }; cmd.Parameters.Add(new SqlParameter("@val", behandlung.GetId())); cmd.Prepare(); SqlDataReader reader = cmd.ExecuteReader(); } }
private void BtnSaveTreatment_Click(object sender, EventArgs e) { DateTime currentDate = DateTime.Today; string currentDateString = DateTime.Today.ToLongDateString(); string description = txtDescription.Text; string examination = txtExamination.Text; double price = Convert.ToDouble(txtPrice.Text); lblCurrentDate.Text = currentDateString; Behandlung behandlung = new Behandlung(currentDate); behandlung.Beschreibung = description; behandlung.Untersuchung = examination; behandlung.Kosten = price; }
public Behandlung GetBehandlung(int id) { using (SqlConnection connection = base.GetSqlConnection()) { connection.Open(); var cmd = new SqlCommand { Connection = connection, CommandText = "SELECT * FROM treatment WHERE id = @val" }; cmd.Parameters.Add(new SqlParameter("@val", id)); cmd.Prepare(); SqlDataReader reader = cmd.ExecuteReader(); Behandlung b = new Behandlung(reader.GetInt32(0), reader.GetDateTime(1)); return(b); } }
public void RemoveBehandlung(Behandlung behandlung) { this.Behandlungen.Remove(behandlung); }
public void AddBehandlung(Behandlung behandlung) { this.Behandlungen.Add(behandlung); }