private void ResetForm() { MessagetextBox.Clear(); EmailtextBox.Clear(); SubjecttextBox.Clear(); NametextBox.Clear(); }
private void Reset() { NametextBox.Clear(); RegistrationtextBox.Clear(); AddresstextBox3.Clear(); MobileNotextBox4.Clear(); DepartmenttextBox5.Clear(); Deletebutton.Enabled = false; }
private void ClearTextBoxes() { foreach (Control ctr in this.Controls) { if (ctr is TextBox) { TextBox txt = ctr as TextBox; txt.Clear(); } } NametextBox.Focus(); }
private void ClearForm() { NametextBox.Clear(); ProfessioncomboBox.SelectedIndex = -1; RacecomboBox.SelectedIndex = -1; StrengthnumericUpDown.Value = 50; IntelligencenumericUpDown.Value = 50; AgilitynumericUpDown.Value = 50; ConstitutionnumericUpDown.Value = 50; CharismanumericUpDown.Value = 50; BiographytextBox.Clear(); }
private void resetToolStripMenuItem_Click(object sender, EventArgs e) { IDtextBox.Clear(); NametextBox.Clear(); EmailtextBox.Clear(); PhonenumbertextBox.Clear(); EventSessiontextBox.Clear(); EventTypetextBox.Clear(); AddresstextBox.Clear(); AssignHalltextBox.Clear(); EstimatedGueststextBox.Clear(); AdvancetextBox.Clear(); CitytextBox.Clear(); TotalAmounttextBox.Clear(); }
private void supplierAddbutton_Click(object sender, EventArgs e) { Supplier1 aSuppllier = new Supplier1(); aSuppllier.SupplierName = NametextBox.Text.Replace("'", "''"); aSuppllier.SupplierInformation = informationtextBox.Text.Replace("'", "''"); Supplier1DAO aDao = new Supplier1DAO(); string sr = aDao.InsertSupplier(aSuppllier); if (sr == "Supplier1 Insert Successfully") { NametextBox.Clear(); informationtextBox.Clear(); } MessageBox.Show(sr); }
private void button1_Click(object sender, EventArgs e) { if (NametextBox.Text == "") { NametextBox.Focus(); } else if (PasswordtextBox.Text == "") { PasswordtextBox.Focus(); } else { // Sign in process int usertype; if (radioButton1.Checked == true) { //User 0 usertype = 0; } else { //Admin 1 usertype = 1; } try { conn.Open(); // Insert to table SqlCommand com = new SqlCommand("INSERT INTO[user] (UserName,Password,UserType,Sign) VALUES(@UserName,@Password,@UserType,@Sign)", conn); com.Parameters.AddWithValue("@UserName", NametextBox.Text); com.Parameters.AddWithValue("@Password", PasswordtextBox.Text); com.Parameters.AddWithValue("@UserType", usertype); com.Parameters.AddWithValue("@Sign", 0); com.ExecuteNonQuery(); conn.Close(); //After Insert Job : FUser_Load(sender, e); // Load again the form to refresh NametextBox.Text = PasswordtextBox.Text = ""; NametextBox.Focus(); MessageBox.Show("User has been registered", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception) { MessageBox.Show("This Username has been already exsit!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnStarSave_Click(object sender, EventArgs e) { //see if any part of RA is wrong if (RAHrTxt_Valid == false || RAMinTxt_Valid == false || RASecTxt_Valid == false) { MessageBox.Show("Right Ascension not correct"); RAHrTxt.Focus(); } //see if any part of Dec is wrong else if (DecDTxt_Valid == false || DecMinTxt_Valid == false || DecSecTxt_Valid == false) { MessageBox.Show("Declination not correct"); DecDTxt.Focus(); } //see if name invalid else if (Name_Valid == false) { MessageBox.Show("Invalid name. cant be blank or start with a space"); NametextBox.Focus(); } else { //data is valid add entry to database connect.Open(); SqlCommand cmd = connect.CreateCommand(); cmd.CommandType = CommandType.Text; //create sql command cmd.CommandText = "insert into StarFavorites (Name, RAHr, RAMin, RASec, DDeg, DMin, DSec) VALUES (@Name, @RAHr, @RAMin, @RASec, @DDeg, @DMin, @DSec)"; cmd.Parameters.AddWithValue("@Name", starName); cmd.Parameters.AddWithValue("@RAHr", RAHr); cmd.Parameters.AddWithValue("@RAMin", RAMin); cmd.Parameters.AddWithValue("@RASec", RASec); cmd.Parameters.AddWithValue("@DDeg", DDeg); cmd.Parameters.AddWithValue("@DMin", DMin); cmd.Parameters.AddWithValue("@DSec", DSec); cmd.ExecuteNonQuery(); connect.Close(); LoadTable(); starPanel.LoadComboBox(); } }
private void ClearForm() { NametextBox.Clear(); AgetextBox.Clear(); Submitbutton.Enabled = false; }
private void ResetForm() { NametextBox.Clear(); EmailtextBox.Clear(); }