partial void DeleteDrug(Drug instance);
 partial void UpdateDrug(Drug instance);
 partial void InsertDrug(Drug instance);
		private void detach_Drugs(Drug entity)
		{
			this.SendPropertyChanging();
			entity.DrugGroup1 = null;
		}
		private void attach_Drugs(Drug entity)
		{
			this.SendPropertyChanging();
			entity.DrugGroup1 = this;
		}
        protected void AddNewDrug_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                TableAddDrug.Visible = false;
                System.Threading.Thread.Sleep(2000);
                String name = DrugName.Text;
                String genname = GenName.Text;
                int price = Convert.ToInt32(Price.Text);
                String unit = Unit.Text;
                int idgrup = Convert.ToInt32(GroupID.Text);

                var drug = new Drug() { DrugName = name, GenericName = genname, Unit = unit, Price = price, drugGroup = idgrup };
                DataBaseAllDataContext dataAll = new DataBaseAllDataContext();
                dataAll.Drugs.InsertOnSubmit(drug);
                dataAll.SubmitChanges();
                GridDrug.DataBind();
            }
        }