private void CleanMe() { ISSid = 0; PartTb.ResetText(); listView2.Clear(); listView2.View = View.Details; listView2.Columns.Add("RB"); listView2.Columns.Add("Name"); listView2.Columns.Add("CodeO"); listView2.Columns.Add("SNO"); listView2.Columns.Add("CNO"); listView2.Columns.Add("CodeN"); listView2.Columns.Add("SNN"); listView2.Columns.Add("CNN"); listView2.Columns.Add("Date"); listView2.Columns.Add("Time"); listView2.Columns.Add("Work done"); listView2.Columns.Add("Comment"); for (int i = 0; i < 12; i++) { listView2.AutoResizeColumn(i, ColumnHeaderAutoResizeStyle.ColumnContent); listView2.AutoResizeColumn(i, ColumnHeaderAutoResizeStyle.HeaderSize); } NameTb.ResetText(); SNTb.ResetText(); CNTb.ResetText(); DateInTb.ResetText(); DateSentTb.ResetText(); IDTb.ResetText(); }
private void InsertBtn_Click(object sender, EventArgs e) { if (NameTb.Text != "" || PhoneTb.Text != "" || AddressTb.Text != "" || FatherNameTb.Text != "" || PhoneTb.Text != "" || SessionTb.Text != "") { _student.Name = NameTb.Text; _student.FatherName = FatherNameTb.Text; _student.Phone = PhoneTb.Text; _student.Address = AddressTb.Text; _student.Session = SessionTb.Text; _student.Class = ClassTb.Text; _student.Email = EmailTb.Text; _student.Dob = DOBvalue.Value; _student.AdminDate = AdminDateValue.Value; _student.Gender = GenderTb.Text; _studentService.InsertStudent(_student); MessageBox.Show("Record Added Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); RollNoTb.ResetText(); NameTb.ResetText(); FatherNameTb.ResetText(); GenderTb.Text = "Select One"; PhoneTb.ResetText(); AddressTb.ResetText(); SessionTb.ResetText(); AdminDateValue.ResetText(); ClassTb.Text = "Select One"; EmailTb.ResetText(); DOBvalue.ResetText(); } else { MessageBox.Show("Please Fill all fields!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void AddItemBtn_Click(object sender, EventArgs e) { if (IdNameCb.SelectedIndex == -1) { MessageBox.Show("Please select an item before updating!"); } else { client.UpdateData(IdNameCb.SelectedIndex + 1, NameTb.Text, descTb.Text, Convert.ToDouble(feeNUD.Value), Convert.ToInt32(quantNUD.Value)); newStand.Items = client.RequestItems(); mainApp.UpdateListMethod(); newStand.Items = client.RequestItems(); IdNameCb.Items.Clear(); foreach (Item item in newStand.Items) { IdNameCb.Items.Add(item.ID + " " + item.Name); } NameTb.Clear(); descTb.Clear(); IdNameCb.SelectedIndex = -1; feeNUD.Value = 0; quantNUD.Value = 0; mainApp.ClearGUI(); } }
private void UpdateBtn_Click(object sender, EventArgs e) { if (NameTb.Text != "" || PhoneTb.Text != "" || AddressTb.Text != "" || GenderTb.SelectedIndex != 0 || SalaryTb.Text != "") { if (TeacherIDTb.Text != "") { _teacher.Id = int.Parse(TeacherIDTb.Text); _teacher.Name = NameTb.Text; _teacher.Phone = PhoneTb.Text; _teacher.Address = AddressTb.Text; _teacher.Gender = GenderTb.Text; _teacher.Salary = int.Parse(SalaryTb.Text); _teacherService.UpdateTeacher(_teacher); MessageBox.Show("Record Updated Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); TeacherIDTb.ResetText(); NameTb.ResetText(); PhoneTb.ResetText(); AddressTb.ResetText(); GenderTb.SelectedIndex = 0; SalaryTb.ResetText(); } else { MessageBox.Show("Please Enter a Teacher Id!", "Teacher Id is not provided", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Please Fill all fields!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void InsertTile_Click(object sender, EventArgs e) { InsertTile.color = Color.FromArgb(242, 242, 242); SelectTile.color = Color.Wheat; DeleteTile.color = Color.Wheat; UpdateTile.color = Color.Wheat; ViewTile.color = Color.Wheat; HideTile.color = Color.Wheat; idGB.Visible = false; grid.Visible = false; detailsGB.Visible = true; UpdateBtn.Visible = false; DeleteBtn.Visible = false; InsertBtn.Visible = true; ClearBtn.Visible = false; RollNoTb.ResetText(); NameTb.ResetText(); FatherNameTb.ResetText(); GenderTb.Text = "Select One"; PhoneTb.ResetText(); AddressTb.ResetText(); SessionTb.ResetText(); AdminDateValue.ResetText(); ClassTb.Text = "Select One"; EmailTb.ResetText(); DOBvalue.ResetText(); }
private void ClearBtn_Click(object sender, EventArgs e) { TeacherIDTb.ResetText(); NameTb.ResetText(); PhoneTb.ResetText(); AddressTb.ResetText(); GenderTb.SelectedIndex = 0; SalaryTb.ResetText(); }
private void ClearBtn_Click(object sender, EventArgs e) { RollNoTb.ResetText(); NameTb.ResetText(); FatherNameTb.ResetText(); GenderTb.Text = "Select One"; PhoneTb.ResetText(); AddressTb.ResetText(); SessionTb.ResetText(); AdminDateValue.ResetText(); ClassTb.Text = "Select One"; EmailTb.ResetText(); DOBvalue.ResetText(); }
private void DiscardBtn_Click(object sender, EventArgs e) { NameViewer.Text = "..."; PriceVewer.Text = "..."; CategoryViewer.Text = "..."; CostViewer.Text = "..."; FinalPriceFinalProduct.Text = "..."; NameTb.Clear(); PriceTb.Clear(); CostTb.Clear(); progressBar1.Value = 0; }
private void button2_Click(object sender, EventArgs e) { listView1.Items.Clear(); comboBox2.ResetText(); comboBox3.ResetText(); comboBox4.ResetText(); ISSSelectorCb.ResetText(); PartTb.ResetText(); NameTb.ResetText(); SNTb.ResetText(); CNTb.ResetText(); DateInTb.ResetText(); DateSentTb.ResetText(); IDTb.ResetText(); }
private void DeleteBtn_Click(object sender, EventArgs e) { if (TeacherIDTb.Text != "") { _teacherService.DeleteTeacher(int.Parse(TeacherIDTb.Text)); MessageBox.Show("Record Deleted!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); TeacherIDTb.ResetText(); NameTb.ResetText(); PhoneTb.ResetText(); AddressTb.ResetText(); GenderTb.SelectedIndex = 0; SalaryTb.ResetText(); } else { MessageBox.Show("Please Enter a Teacher Id!", "Teacher Id is not provided", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void IdNameCb_SelectedIndexChanged(object sender, EventArgs e) { int index = IdNameCb.SelectedIndex; NameTb.Clear(); descTb.Clear(); feeNUD.Value = 0; quantNUD.Value = 0; foreach (Item ite in newStand.Items) { if (ite.ID == index + 1) { NameTb.Text = ite.Name; descTb.Text = ite.Description; feeNUD.Value = Convert.ToDecimal(ite.Fee); quantNUD.Value = Convert.ToDecimal(ite.Quantity); } } }
private void InsertTile_Click(object sender, EventArgs e) { InsertTile.color = Color.FromArgb(242, 242, 242); SelectTile.color = Color.Wheat; DeleteTile.color = Color.Wheat; UpdateTile.color = Color.Wheat; ViewTile.color = Color.Wheat; HideTile.color = Color.Wheat; idGB.Visible = false; grid.Visible = false; detailsGB.Visible = true; UpdateBtn.Visible = false; DeleteBtn.Visible = false; InsertBtn.Visible = true; ClearBtn.Visible = false; TeacherIDTb.ResetText(); NameTb.ResetText(); PhoneTb.ResetText(); AddressTb.ResetText(); GenderTb.SelectedIndex = 0; SalaryTb.ResetText(); }
private void DeleteBtn_Click(object sender, EventArgs e) { if (RollNoTb.Text != "") { _studentService.DeleteStudent(int.Parse(RollNoTb.Text)); MessageBox.Show("Record Deleted!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); NameTb.ResetText(); FatherNameTb.ResetText(); GenderTb.Text = "Select One"; PhoneTb.ResetText(); AddressTb.ResetText(); SessionTb.ResetText(); AdminDateValue.ResetText(); ClassTb.Text = "Select One"; EmailTb.ResetText(); DOBvalue.ResetText(); } else { MessageBox.Show("Please Enter a RollNo!", "RollNo. is not provided", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private TextBox Focused() { if (NameTb.Focus()) { return(NameTb); } else if (ValueTb.Focus()) { return(ValueTb); } else if (DescriptionTb.Focus()) { return(DescriptionTb); } else if (SearchTB.Focus()) { return(SearchTB); } else { return(NameTb); } }
private void NameTb_MouseDown(object sender, MouseButtonEventArgs e) { NameTb.Focusable = true; NameTb.CaretIndex = NameTb.CaretIndex; NameTb.Focus(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { NameTb.Focus(); }
private void validateAllFields() => _fswvm.AllFieldIsValid = NameTb.VerifyData() && EmailTb.VerifyData() && DonateTb.VerifyData();
private void JoinLobbyButton_OnClick(object sender, RoutedEventArgs e) { NameTb.Focus(FocusState.Programmatic); }