protected void AddHospitalButton_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            String btnId = btn.ID;

            if (btnId.Equals("AddHospitalButton"))
            {
                if (IsValid)
                {
                    System.Threading.Thread.Sleep(3000);
                    var hospitalName = NameTextBox.Text;
                    var hospitalAddress = AddressTextBox.Text;
                    var hospitalLicense = LicenseTextBox.Text;

                    var hospital = new Hospital() { hospitalName = hospitalName, address = hospitalAddress, license = hospitalLicense };
                    _dataContext.Hospitals.InsertOnSubmit(hospital);
                    _dataContext.SubmitChanges();
                    HospitalList.DataBind();

                    ResetInputField();
                }
            }
            else if (btnId.Equals("ResetHospitalButton"))
            {
                ResetInputField();
            }
        }
예제 #2
0
 partial void DeleteHospital(Hospital instance);
예제 #3
0
 partial void UpdateHospital(Hospital instance);
예제 #4
0
 partial void InsertHospital(Hospital instance);