protected void AddNewDrug_Click(object sender, EventArgs e) { if (IsValid) { TableAddDrug.Visible = false; String name = DrugName.Text; int gender = Convert.ToInt32(GenderDrop.SelectedValue); String address = Unit.Text; DateTime dob = DateTime.Parse(Price.Text); String license = GroupID.Text; var drug = new Doctor() { Name = name, Gender = gender, Address = address, DoB = dob, License = license }; DataBaseAllDataContext dataAll = new DataBaseAllDataContext(); dataAll.Doctors.InsertOnSubmit(drug); dataAll.SubmitChanges(); ViewState["state"] = "load"; GridDrug.DataBind(); TableAddDrug.Visible = false; GridDrug.Visible = true; } }
partial void UpdateDoctor(Doctor instance);
partial void DeleteDoctor(Doctor instance);
partial void InsertDoctor(Doctor instance);