protected void AddNewDrug_ClickG(object sender, EventArgs e)
 {
     if (IsValid)
     {
         TableAddDrugG.Visible = false;
         int iddoctor = Convert.ToInt32(DoctorID.Text);
         DateTime dat = DateTime.Parse(date.Text);
         var drug = new Prescription() { DoctorID = iddoctor, Date = dat };
         DataBaseAllDataContext dataAll = new DataBaseAllDataContext();
         dataAll.Prescriptions.InsertOnSubmit(drug);
         dataAll.SubmitChanges();
         GridDrugG.DataBind();
         ViewState["state"] = "load";
     }
 }
 protected void AddPreToData_Click(object sender, EventArgs e)
 {
     PreAddnew.Visible = false;
     int iddoctor = Convert.ToInt32(DoctorIDpre.Text);
     DateTime dat = DateTime.Parse(datePro.Text);
     var drug = new Prescription() { DoctorID = iddoctor, Date = dat };
     DataBaseAllDataContext dataAll = new DataBaseAllDataContext();
     dataAll.Prescriptions.InsertOnSubmit(drug);
     dataAll.SubmitChanges();
     AddPrescriptionGrid.DataBind();
 }
 partial void DeletePrescription(Prescription instance);
 partial void UpdatePrescription(Prescription instance);
 partial void InsertPrescription(Prescription instance);
		private void detach_Prescriptions(Prescription entity)
		{
			this.SendPropertyChanging();
			entity.Doctor = null;
		}