Ejemplo n.º 1
0
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     IdTb.ResetText();
     TotalAttendanceTb.ResetText();
     PresentTb.ResetText();
     AbsenteesTb.ResetText();
 }
Ejemplo n.º 2
0
 private void UpdateBtn_Click(object sender, EventArgs e)
 {
     if (TotalAttendanceTb.Text != "" || PresentTb.Text != "" || AbsenteesTb.Text != "")
     {
         if (IdTb.Text != "")
         {
             _teacherAttendance.TeacherId       = int.Parse(IdTb.Text);
             _teacherAttendance.Presence        = int.Parse(PresentTb.Text);
             _teacherAttendance.Absentees       = int.Parse(AbsenteesTb.Text);
             _teacherAttendance.TotalAttendance = int.Parse(TotalAttendanceTb.Text);
             _teacherAttendanceService.UpdateTeacherAttendance(_teacherAttendance);
             MessageBox.Show("Record Updated Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
             IdTb.ResetText();
             TotalAttendanceTb.ResetText();
             PresentTb.ResetText();
             AbsenteesTb.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);
     }
 }
Ejemplo n.º 3
0
 private void DeleteBtn_Click(object sender, EventArgs e)
 {
     if (IdTb.Text != "")
     {
         _teacherAttendanceService.DeleteTeacherAttendance(int.Parse(IdTb.Text));
         MessageBox.Show("Record Deleted!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         IdTb.ResetText();
         TotalAttendanceTb.ResetText();
         PresentTb.ResetText();
         AbsenteesTb.ResetText();
     }
     else
     {
         MessageBox.Show("Please Enter a Teacher Id!", "Teacher Id is not provided", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Ejemplo n.º 4
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;
     grid.Visible      = false;
     detailsGB.Visible = true;
     UpdateBtn.Visible = false;
     DeleteBtn.Visible = false;
     InsertBtn.Visible = true;
     ClearBtn.Visible  = false;
     searchBtn.Visible = false;
     IdTb.ResetText();
     TotalAttendanceTb.ResetText();
     PresentTb.ResetText();
     AbsenteesTb.ResetText();
 }
 private void InsertBtn_Click(object sender, EventArgs e)
 {
     if (IdTb.Text != "" || TotalAttendanceTb.Text != "" || PresentTb.Text != "" || AbsenteesTb.Text != "")
     {
         _studentAttendance.StudentId       = int.Parse(IdTb.Text);
         _studentAttendance.Presence        = int.Parse(PresentTb.Text);
         _studentAttendance.Absentees       = int.Parse(AbsenteesTb.Text);
         _studentAttendance.TotalAttendance = int.Parse(TotalAttendanceTb.Text);
         _studentAttendanceService.InsertStudentAttendance(_studentAttendance);
         MessageBox.Show("Record Added Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         IdTb.ResetText();
         TotalAttendanceTb.ResetText();
         PresentTb.ResetText();
         AbsenteesTb.ResetText();
     }
     else
     {
         MessageBox.Show("Please Fill all fields!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }