private void Save() { this.grbRequestCode.Enabled = false; this.grbConfirmCode.Enabled = false; Properties.Settings.Default.PhoneNumber = tbPhoneNumber.Text; Properties.Settings.Default.Password = password; Properties.Settings.Default.FullName = tbFullName.Text; Properties.Settings.Default.Save(); if (Globals.DB.Accounts.FindByAccountID(tbPhoneNumber.Text) == null) { AppData.AccountsRow row = Globals.DB.Accounts.NewAccountsRow(); row.AccountID = tbPhoneNumber.Text; row.FullName = tbFullName.Text; row.Password = password; Globals.DB.Accounts.AddAccountsRow(row); Globals.DB.Accounts.AcceptChanges(); Globals.DB.Accounts.WriteXml(string.Format("{0}\\accounts.dat", Application.StartupPath)); } DialogResult = System.Windows.Forms.DialogResult.OK; }
public void Save() { //Storing the users account information this.grbConfirm.Enabled = false; this.grbRequest.Enabled = false; Properties.Settings.Default.PhoneNumber = txtNumber.Text; Properties.Settings.Default.Password = password; Properties.Settings.Default.FullName = txtName.Text; Properties.Settings.Default.Save(); //Create a new record if the number doesnt already exist if (Globals.DB.Accounts.FindByAccountId(txtNumber.Text) == null) { AppData.AccountsRow row = Globals.DB.Accounts.NewAccountsRow(); row.AccountId = txtNumber.Text; row.FullName = txtName.Text; row.Password = password; Globals.DB.Accounts.AddAccountsRow(row); Globals.DB.Accounts.AcceptChanges(); Globals.DB.Accounts.WriteXml(string.Format("{0}\\accounts.dat", Application.StartupPath)); } DialogResult = System.Windows.Forms.DialogResult.OK; }