/// <summary> /// Will clean all the text fields /// </summary> private void ClearFields() { EventNameTextBox.Clear(); InitializeDatePicker(); InitializeTimePicker(); DescriptionTextBox.Clear(); }
private async void CreateFoodButton_Click(object sender, EventArgs e) { if (_isHubConnectionStarted is false) { await _hubConnection.StartAsync(); _isHubConnectionStarted = true; } CreateFoodDto createFoodDto = new CreateFoodDto { Name = NameTextBox.Text, Description = DescriptionTextBox.Text, Ingredients = IngredientsTextBox.Text, }; await _hubConnection.SendAsync("CreateFood", createFoodDto); _hubConnection.On <bool>("CreateFoodResult", handler => { if (handler) { MessageBox.Show("Created."); NameTextBox.Clear(); DescriptionTextBox.Clear(); IngredientsTextBox.Clear(); } else { MessageBox.Show("Faild to create."); } }); }
private void Clear() { ProductIdTextBox.Clear(); ProductNameTextBox.Clear(); DescriptionTextBox.Clear(); ProductPriceTextBox.Clear(); NewProductArrivedTextBox.Clear(); onHandCount.Clear(); }
private void SaveButton_Click(object sender, EventArgs e) { new LogController().AddLogEntry(TitleTextBox.Text, DateTimePicker.Value, StartTimeTimePicker.Value, EndTimeTimePicker.Value, HoursWorkedTimePicker.Value, DescriptionTextBox.Text, AuthorTextBox.Text); TitleTextBox.Clear(); DescriptionTextBox.Clear(); AuthorTextBox.Clear(); MessageBox.Show("New log entry added!", "Log added!"); }
private void RestoreDefaultValues() { TitleTextBox.Clear(); DescriptionTextBox.Clear(); StartDatePicker.Value = _dateTimeProvider.Today; DueDatePicker.Value = _dateTimeProvider.Today; StatusBox.SelectedIndex = 0; PriorityBox.SelectedIndex = 0; UsersBox.SelectedIndex = 0; }
public void OnWorkspaceReset() { PatchListView.Items.Clear(); DescriptionTextBox.Clear(); ConflictsTextBox.Clear(); ApplyPatchesButton.Enabled = false; RollbackPatchesButton.Enabled = false; OpenInEditorButton.Enabled = false; CheckForUpdatesButton.Enabled = false; ReloadPatchesButton.Enabled = false; }
private void Clear_All() { AssetTagTextBox.Clear(); AssetTagSearchTextBox.Clear(); SerialTextBox.Clear(); SerialSearchTextBox.Clear(); CurrrentUserTextBox.Clear(); DescriptionTextBox.Clear(); ReplaceYearTextBox.Clear(); TrackablesCheckBox.Checked = false; HistoricalCheckBox.Checked = false; RefreshCombos(); }
private void clearEntryFields(bool resetPatientId) { if (resetPatientId) { PatientIdInput.Text = "01"; } ClaimDetails.SelectedIndex = -1; ItemNumberInput.Text = ""; DescriptionTextBox.Clear(); UseAlternateBodyPart.IsChecked = false; DOSInput.Value = DateTime.Today; ItemFeeInput.Text = ""; ScriptInput.Text = ""; }
private void ResetFormControl() { TitleTextBox.Clear(); DescriptionTextBox.Clear(); TitleTextBox.Focus(); //moves cursor to TitleTextBox // Check if form is loaded for updated process if (this.IsUpdate) { this.RoleId = 0; this.IsUpdate = false; SaveButton.Text = "Save Information"; DeleteButton.Enabled = false; } }
private void AddCourseButton_Click(object sender, RoutedEventArgs e) { mytrimer(); if (CheckIfThereIsEmptyTextBox()) { MessageBox.Show("Some textbox is missing."); } else { if (CheckNumberOfStudentsTextBoxes() && CheckGradesTextBoxes() && CheckHoursTextBox() && CheckAllTheRemainingTextBoxes()) { string Code = CodeTextBox.Text; string CourseName = CourseNameTextBox.Text; int MaximumNumber = int.Parse(MaximumNumberOfStudentsTextBox.Text); int CurrentNumber = int.Parse(CurrentNumberOfStudentsTextBox.Text); int PassingGrade = int.Parse(PassingGradeTextBox.Text); int CourseGrade = int.Parse(CourseGradeTextBox.Text); int Hours = int.Parse(HoursTextBox.Text); string Instructor = InstructorTextBox.Text; string Description = DescriptionTextBox.Text; CoursePrerequstiesTmp = new List <string>(); if (WelcomePage.AllCoursesDictionary.ContainsKey(CourseName)) { MessageBox.Show("This course already exists."); } else { AddNewCourseSecondStep nw = new AddNewCourseSecondStep(); nw.ShowDialog(); Course newcourse = new Course(Code, CourseName, MaximumNumber, CurrentNumber, PassingGrade, CourseGrade, Hours, Instructor, Description, CoursePrerequstiesTmp); WelcomePage.AllCoursesDictionary[CourseName] = newcourse; CodeTextBox.Clear(); CourseNameTextBox.Clear(); MaximumNumberOfStudentsTextBox.Clear(); //CurrentNumberOfStudentsTextBox.Clear(); PassingGradeTextBox.Clear(); CourseGradeTextBox.Clear(); HoursTextBox.Clear(); InstructorTextBox.Clear(); DescriptionTextBox.Clear(); } } } }
private void ResetFormControl() { UserNameTextBox.Clear(); PasswordTextBox.Clear(); RolesComboBox.SelectedIndex = 0; IsActiveCheckBox.Checked = true; DescriptionTextBox.Clear(); UserNameTextBox.Focus(); if (this.IsUpdate) { this.IsUpdate = false; SaveButton.Text = "Save User Information"; DeleteButton.Enabled = false; this.UserName = null; } }
private void ResetFormControl() { StudentNameTextBox.Clear(); AgeTextBox.Clear(); GenderTextBox.Clear(); DescriptionTextBox.Clear(); IdPictureBox.Dispose(); StudentNameTextBox.Focus(); if (this.IsUpdate) { this.StudentId = 0; this.IsUpdate = false; SaveButton.Text = "Save User Information"; DeleteButton.Enabled = false; ViewStudentForm vsf = new ViewStudentForm(); //vsf.LoadDataIntoDataGridView(); vsf.StudentDataGridView.Refresh(); } }
//Enter the Description in Profile Section internal void AddDescription() { //Clicking on Edit button GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//h3[text()='Description']//i[@class='outline write icon']", 6); EditDescription.Click(); Thread.Sleep(1000); //Clearing the description textarea if any text already existing GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//textarea[@name='value']", 6); DescriptionTextBox.Clear(); //Entering new description GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//textarea[@name='value']", 6); DescriptionTextBox.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "ProfileDescription")); //Clicking on Save button GenericWait.ElementIsVisible(GlobalDefinitions.driver, "XPath", "//h3[text()='Description']/../..//button[text()='Save']", 6); SaveDescription.Click(); string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Profile Description"); //Validate message GlobalDefinitions.MessageValidation("Description has been saved successfully"); }
private void AddAndAddAnotherButton_Click(object sender, EventArgs e) { try { XMLHelper helper = new XMLHelper(); MailServer NewServer = new MailServer() { ID = helper.LastElementUniqueID(XMLDataStorage.Location + "MailServers.xml", "Server") + 1, Name = NameTextBox.Text, Description = DescriptionTextBox.Text, Host = HostTextBox.Text, Port = Convert.ToInt32(PortTextBox.Text), Username = UsernameTextBox.Text, Password = PasswordTextBox.Text, FromAddress = FromAddressTextBox.Text, IsSecured = IsSecuredCheckbox.Checked }; mailServerManager.Add(NewServer); MessageBox.Show("Mail Server is successfully added"); NameTextBox.Clear(); DescriptionTextBox.Clear(); HostTextBox.Clear(); PortTextBox.Clear(); UsernameTextBox.Clear(); PasswordTextBox.Clear(); FromAddressTextBox.Clear(); IsSecuredCheckbox.Checked = false; } catch (Exception ex) { MessageBox.Show("Failed to add new mail server", ex.Message); } }
//Submit button inserts Bicycle private void SubmitButton_Click(object sender, RoutedEventArgs e) { string bikeMakeText = BikeMakeTextBox.Text; string modelNumberText = ModelNumberTextBox.Text; string serialNumberText = SerialNumberTextBox.Text; string colorText = ColorTextBox.Text; string descriptionText = DescriptionTextBox.Text; string locationText = LocationTextBox.Text; string physicalConditionText = PhysicalConditionTextBox.Text; string notesText = NotesTextBox.Text; Vehicle newVehicle = new Vehicle(bikeMakeText, modelNumberText, serialNumberText, colorText, descriptionText, locationText, physicalConditionText, notesText); newVehicle.insert(); BikeMakeTextBox.Clear(); ModelNumberTextBox.Clear(); SerialNumberTextBox.Clear(); ColorTextBox.Clear(); DescriptionTextBox.Clear(); NotesTextBox.Clear(); MessageBox.Show("Vehicle inserted successfully!"); this.Hide(); myCaller.Show(); }
private void ClearTextBoxes() { IDTextBox.Clear(); NameTextBox.Clear(); DescriptionTextBox.Clear(); }
private void ConfirmButonForInsert_Click(object sender, EventArgs e) { String productId = ProductIdTextBox.Text; String productName = MedicineNameTextBox.Text; String genericName = GenericNameTextBox.Text; String mgfDate = MgfdateTextBox.Text; String expDate = ExprDateTextBox.Text; String productAmmount = ProductAmmountTextBox.Text; String description = DescriptionTextBox.Text; byte[] file_byte = ImageToByteArray(pictureBox1.Image); SqlConnection conn = new SqlConnection(connection); conn.Open(); if (conn.State == System.Data.ConnectionState.Open) { if (ConfirmButonForInsert.Text == "Confirm") { String q = "INSERT INTO Product (ProductId,ProductName,GenericName, MgfDate,ExpDate, ProductAmmount,Description,MedicineImage )VALUES ('" + productId + "','" + productName + "','" + genericName + "','" + mgfDate + "','" + expDate + "','" + productAmmount + "','" + description + "','" + file_byte + "')"; SqlCommand cmd = new SqlCommand(q, conn); cmd.ExecuteNonQuery(); MessageBox.Show("tamak"); } else if (ConfirmButonForInsert.Text == "Update") { try { String q = "UPDATE Product SET ProductName='" + ProductName + "' WHERE ProductId='" + productId + "'"; SqlCommand cmd = new SqlCommand(q, conn); cmd.ExecuteNonQuery(); conn.Close(); MessageBox.Show("Update Success"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { try { String q = "DELETE from Product WHERE ProductId='" + productId + "'"; SqlCommand cmd = new SqlCommand(q, conn); cmd.ExecuteNonQuery(); conn.Close(); MessageBox.Show("Delete Success"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } ProductIdTextBox.Clear(); MedicineNameTextBox.Clear(); GenericNameTextBox.Clear(); MgfdateTextBox.Clear(); ExprDateTextBox.Clear(); ProductAmmountTextBox.Clear(); DescriptionTextBox.Clear(); conn.Close(); }
public void OnWorkspaceReset() { PatchListView.Items.Clear(); DescriptionTextBox.Clear(); ConflictsTextBox.Clear(); }