protected void AddNewDrug_Click(object sender, EventArgs e) { if (IsValid) { TableAddDrug.Visible = false; int quantity = Convert.ToInt32(Quantity.Text); int dose = Convert.ToInt32(Dose.Text); int idpre = Convert.ToInt32(PresID.Text); int iddrug = Convert.ToInt32(DrugID.Text); String intruc = Instruction.Text; var drug = new PrescriptionDetail() { PrescripID = idpre, DrugID = iddrug, Dose = dose, Quantity = quantity, Instruction = intruc }; DataBaseAllDataContext dataAll = new DataBaseAllDataContext(); dataAll.PrescriptionDetails.InsertOnSubmit(drug); dataAll.SubmitChanges(); GridDrug.DataBind(); } }
partial void DeletePrescriptionDetail(PrescriptionDetail instance);
partial void UpdatePrescriptionDetail(PrescriptionDetail instance);
partial void InsertPrescriptionDetail(PrescriptionDetail instance);
private void detach_PrescriptionDetails(PrescriptionDetail entity) { this.SendPropertyChanging(); entity.Prescription = null; }
private void attach_PrescriptionDetails(PrescriptionDetail entity) { this.SendPropertyChanging(); entity.Drug = this; }