示例#1
0
 private void buttonSaveAndSubmit_Click(object sender, EventArgs e)
 {
     if (this.verifyInfo())
     {
         ConnectDB EMRDatabase = new ConnectDB();
         if (this.activeTab == "add")
         {
             EMRDatabase.AddUser(this.textSetSSN.Text, this.textSetFirstName.Text, this.textSetLastName.Text, this.textSetEmail.Text, this.textSetAddress.Text, this.textSetPhoneNumber.Text, this.comboSetPosition.SelectedItem.ToString());
             EMRDatabase.AddUserAccount(this.textSetSSN.Text, this.textSetUsername.Text, this.textSetPassword.Text, this.comboSetPrivilege.SelectedItem.ToString(), this.comboSetStatus.SelectedItem.ToString());
         }
         if (this.activeTab == "modify")
         {
             EMRDatabase.ModifyUser(this.textSearch.Text, this.textSetSSN.Text, this.textSetFirstName.Text, this.textSetLastName.Text, this.textSetEmail.Text, this.textSetAddress.Text, this.textSetPhoneNumber.Text, this.comboSetPosition.SelectedItem.ToString());
             EMRDatabase.ModifyUserAccount(this.textSetSSN.Text, this.textSetUsername.Text, this.textSetPassword.Text, this.comboSetPrivilege.SelectedItem.ToString(), this.comboSetStatus.SelectedItem.ToString());
         }
     }
     else
     {
         MessageBox.Show("Please fill all fields");
     }
 }