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 SaveButton_Click(object sender, EventArgs e) { string email = ""; if (FormatHelper.IsEmailAddress(EmailTb.Text)) { email = EmailTb.Text; } else { MessageBox.Show("Неверный формат E-Mail", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); EmailTb.SelectAll(); } var client = new Client() { Id = int.Parse(IdTb.Text), Username = UsernameTb.Text, LastName = LastNameTb.Text, FirstName = FirstNameTb.Text, Email = email, PhoneNumber = PhoneNumberTb.Text }; var args = new SaveClientArgs(client); SaveButtonClick?.Invoke(this, args); }
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); } }
public void CreateNew() { profileIdTB.Clear(); nameTb.Clear(); EmailTb.Clear(); mobileTb.Clear(); psswordTb.Clear(); AddressRtb.Clear(); roleCb.SelectedIndex = -1; statusCb.SelectedIndex = -1; Rand(); nameTb.Focus(); }
public void CreateNew() { memberTB.Clear(); nameTb.Clear(); EmailTb.Clear(); mobileTb.Clear(); DateofBirth.Refresh(); DateofJoin.Refresh(); AddressRtb.Clear(); planCb.SelectedIndex = -1; statusCb.SelectedIndex = -1; Rand(); nameTb.Focus(); }
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 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 void validateAllFields() => _fswvm.AllFieldIsValid = NameTb.VerifyData() && EmailTb.VerifyData() && DonateTb.VerifyData();