Example #1
0
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     IdTb.ResetText();
     TotalAttendanceTb.ResetText();
     PresentTb.ResetText();
     AbsenteesTb.ResetText();
 }
Example #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);
     }
 }
Example #3
0
 private void UpdateBtn_Click(object sender, EventArgs e)
 {
     if (UsernameTb.Text != "" || PasswordTb.Text != "" || RecoveryTb.Text != "")
     {
         if (IdTb.Text != "")
         {
             DialogResult result = MessageBox.Show("Do You Really Want To Update this Account?", "Confirm Update", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
             if (result == DialogResult.OK)
             {
                 _admin.Id           = int.Parse(IdTb.Text);
                 _admin.Username     = UsernameTb.Text;
                 _admin.Password     = PasswordTb.Text;
                 _admin.RecoveryName = RecoveryTb.Text;
                 _adminService.UpdateLogín(_admin);
                 AdminService adminService = new AdminService();
                 var          dataSource   = adminService.GetLogínsDataTable();
                 grid.DataSource = dataSource;
                 MessageBox.Show("Account Updated Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 IdTb.ResetText();
                 UsernameTb.ResetText();
                 PasswordTb.ResetText();
                 RecoveryTb.ResetText();
             }
         }
     }
     else
     {
         MessageBox.Show("Please Select an account from the grid!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Example #4
0
 private void ClearBtn_Click(object sender, EventArgs e)
 {
     IdTb.ResetText();
     UsernameTb.ResetText();
     PasswordTb.ResetText();
     RecoveryTb.ResetText();
 }
Example #5
0
 private void CreateAccountBtn_Click(object sender, EventArgs e)
 {
     if (UsernameTb.Text != "" || PasswordTb.Text != "" || RecoveryTb.Text != "")
     {
         _admin.Username     = UsernameTb.Text;
         _admin.Password     = PasswordTb.Text;
         _admin.RecoveryName = RecoveryTb.Text;
         _adminService.InsertLogín(_admin);
         AdminService adminService = new AdminService();
         var          dataSource   = adminService.GetLogínsDataTable();
         grid.DataSource = dataSource;
         MessageBox.Show("Account Created Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         IdTb.ResetText();
         UsernameTb.ResetText();
         PasswordTb.ResetText();
         RecoveryTb.ResetText();
     }
     else
     {
         MessageBox.Show("Please Fill in the fields!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         IdTb.ResetText();
         UsernameTb.ResetText();
         PasswordTb.ResetText();
         RecoveryTb.ResetText();
     }
 }
Example #6
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);
     }
 }
Example #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;
     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);
     }
 }
Example #9
0
 private void DeleteBtn_Click(object sender, EventArgs e)
 {
     if (IdTb.Text != "")
     {
         DialogResult result = MessageBox.Show("Do You Really Want To Delete this Account?", "Confirm Delete", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (result == DialogResult.OK)
         {
             _adminService.DeleteLogín(int.Parse(IdTb.Text));
             AdminService adminService = new AdminService();
             var          dataSource   = adminService.GetLogínsDataTable();
             grid.DataSource = dataSource;
             MessageBox.Show("Account Deleted Successfully!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
             IdTb.ResetText();
             UsernameTb.ResetText();
             PasswordTb.ResetText();
             RecoveryTb.ResetText();
         }
     }
     else
     {
         MessageBox.Show("Please Select an Id from the grid!", "Id is not provided", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }