private void okbtn_Click(object sender, RoutedEventArgs e) { if (f.CheckForInternetConnection()) { int mone_for_id = 0; if (editorregisetr == 1) { string protectlowername = this.usernameTB.Text; protectlowername = protectlowername.ToLower(); this.us.setusername(protectlowername); if (this.passwordTB.Password.ToString() != "") { this.us.setpassword(f.strEncryptred(this.passwordTB.Password.ToString())); } if ((bool)isAdminCB.IsChecked == true) { this.us.superuser = 1; this.us.copmanyID = 0; } if ((bool)isAdminCB.IsChecked == false) { this.us.superuser = 0; this.us.copmanyID = f.removequat(this.us.copmanyID); } } else { this.us = new user(); string protectlowername = this.usernameTB.Text; protectlowername = protectlowername.ToLower(); this.us.setusername(protectlowername); if (this.passwordTB.Password.ToString() != "") { this.us.setpassword(f.strEncryptred(this.passwordTB.Password.ToString())); } if ((bool)isAdminCB.IsChecked == true) { this.us.superuser = 1; this.us.copmanyID = 0; } if ((bool)isAdminCB.IsChecked == false) { this.us.superuser = 0; this.us.copmanyID = f.removequat(this.companyNameTB.Tag.ToString()); } mone_for_id = f.num_of_mone("users", "usersmone"); this.us.setuserid(mone_for_id + 1); } if (this.passwordTB.Password.ToString() == "" || this.usernameTB.Text == "") { MessageBox.Show("השדות לא יכולים להיות ריקים"); } else { f.commitUser(this.us); MessageBox.Show("בוצע בהצלחה"); } if (this.editForCompany > 0) { compnaymanage win = new compnaymanage(this.com, this.us); win.Show(); this.Close(); } else { superuser win = new superuser(); win.Show(); this.Close(); } } else { MessageBox.Show("אין אינטרנט"); } }