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();
 }
Esempio n. 2
0
 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 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);
     }
 }
Esempio n. 4
0
 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();
 }
Esempio n. 6
0
 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);
     }
 }
Esempio n. 7
0
 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);
     }
 }