コード例 #1
0
 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();
     }
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 public void RemoveBehandlung(Behandlung behandlung)
 {
     this.Behandlungen.Remove(behandlung);
 }
コード例 #5
0
 public void AddBehandlung(Behandlung behandlung)
 {
     this.Behandlungen.Add(behandlung);
 }