public ContraindicationsControl(contraindicationsData dat, dataBase _connector, string _idpat) { data = dat; connector = new dataBase(); idpat = _idpat; connector = _connector; }
private void button2_Click(object sender, EventArgs e) { this.Visible = false; contraindicationsData data = new contraindicationsData(); contraindications showCon = new contraindications(pat[0], type, connector, data); showCon.ShowDialog(); this.Visible = true; }
public void deleteContraindications(contraindicationsData cont, string atr) { try { command.CommandText = "Update [protivopokazaniya] set [" + atr + "] = '' where [idPatient] = " + cont.IdPatient; command.ExecuteNonQuery(); } catch { command.CommandText = "delete from [protivopokazaniya] where [idPatient] = " + cont.IdPatient; command.ExecuteNonQuery(); } }
public contraindications(string _idPatient, int type, dataBase _d, contraindicationsData _dat) { InitializeComponent(); idPatient = new patientData(); idPatient.Id = _idPatient; d = _d; data = _dat; cont = new ContraindicationsControl(data, d, _idPatient); if (type == 2) { textBox1.ReadOnly = true; textBox2.ReadOnly = true; button1.Visible = false; button2.Visible = false; } }
public void updateContraindications(contraindicationsData cont) { if (cont.HaveRecord) { try { command.CommandText = "Update [protivopokazaniya] set [protivo] = '" + cont.Contraindications + "', [allergiya] = '" + cont.Allergy + "' where [idPatient] = " + cont.IdPatient; command.ExecuteNonQuery(); } catch { } } else { try { command.CommandText = "Insert into [protivopokazaniya] ([protivo],[allergiya],[idPatient]) values ('" + cont.Contraindications + "', '" + cont.Allergy + "'," + cont.IdPatient + ")"; command.ExecuteNonQuery(); } catch { } } }
public void delete(string word) { data = load(); connector.deleteContraindications(data, word); }