private void ClearForm() { if (AutoPartId == 0) { AutoPartTextbox.Clear(); DescriptionTextbox.Clear(); MakeTextbox.Clear(); ModelTextbox.Clear(); brandBindingSource.Position = -1; BrandDropdown.SelectedIndex = -1; SellingPriceTextbox.Text = "0.00"; SellingPrice2Textbox.Text = "0.00"; PurchasePriceTextbox.Text = "0.00"; ReorderTextbox.Text = "0"; InitialQtyTextbox.Text = "0"; UnitTextbox.Clear(); PartNumberTextbox.Clear(); SizeTextbox.Clear(); AltTextbox.Clear(); PictureTextbox.Clear(); } else { LoadPartDetails(); } }
private void ClearScreen() { SiteNameTextbox.Clear(); LatitudeTextbox.Clear(); LongitudeTextbox.Clear(); DescriptionTextbox.Clear(); TownsCombobox.Items.Clear(); }
private void SaveFile_Button_Click(object sender, EventArgs e) { if (AlertGroupTextbox.Text == AGTEXT || DescriptionTextbox.Text == DESCTEXT || SolutionsTextbox.Text == SLNTEXT) { return; } DialogResult result; if (AlertGroupTextbox.Text == "") { return; } if (DescriptionTextbox.Text == "") { result = MessageBox.Show("You have to write a description and add solutions.", "Saving Denied", MessageBoxButtons.OK, MessageBoxIcon.Error); if (result == DialogResult.Cancel) { return; } } if (DescriptionTextbox.Text != "") { result = MessageBox.Show("Have you finished writing everything?" + "\r\n" + "Also, make sure your info is correct and valid.", "Confirm Saving?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.No) { return; } String AlertGroup = AlertGroupTextbox.Text; String DirectoryPath = @"E:\DB"; String Path = DirectoryPath + @"\" + AlertGroup + ".txt"; String text = "Alert Description:" + "\r\n" + DescriptionTextbox.Text + "\r\n" + "\r\n" + "\r\n" + "\r\n" + "\r\n" + "Suggested Solution: " + "\r\n" + SolutionsTextbox.Text; File.WriteAllText(Path, text); MessageBox.Show("Your alert has been added", "New Alert", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); AlertGroupTextbox.Clear(); DescriptionTextbox.Clear(); SolutionsTextbox.Clear(); } }