private void btnAtAdStrtTime_Click(object sender, EventArgs e) { try { Buisness_Logic.empAttendence em = new Buisness_Logic.empAttendence(); em.empID = int.Parse(txtEmpIDatte.Text); em.theDay = txtempAT_theday.Text; em.startTime = txtStartTime.Text; Buisness_Logic.empAttendence_repository emprep = new Buisness_Logic.empAttendence_repository(); if (emprep.addStartTime(em)) { MessageBox.Show("Success", "Start time and day are added to the database.", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Failed.", "Data Insertion", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ew) { throw; } }
private void btnAtAdEndTime_Click(object sender, EventArgs e) { try { Buisness_Logic.empAttendence em1 = new Buisness_Logic.empAttendence(); em1.empID = int.Parse(txtEmpIDatte.Text); em1.theDay = txtempAT_theday.Text; em1.startTime = txtStartTime.Text; em1.endTime = textAtEndTime.Text; Buisness_Logic.empAttendence_repository emprep1 = new Buisness_Logic.empAttendence_repository(); if (emprep1.addEndTime(em1)) { MessageBox.Show("Success", "Data Insertion", MessageBoxButtons.OK, MessageBoxIcon.Information); textAtTotalHr.Text = em1.hoursWorked.ToString(); } else { MessageBox.Show("Failed.", "Data Insertion", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ew) { throw; } }
private void btnAtSerchM_Click(object sender, EventArgs e) { try { Buisness_Logic.empAttendence ea1 = new Buisness_Logic.empAttendence(); ea1.empID = int.Parse(txtEmpIDatte.Text); ea1.theDay = DateTime.Today.ToShortDateString(); Buisness_Logic.empAttendence_repository emarep2 = new Buisness_Logic.empAttendence_repository(); if (emarep2.searchMemAt(ea1)) { MessageBox.Show("Employee attendence record found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); txtStartTime.Text = ea1.startTime; txtempAT_theday.Text = ea1.theDay; if (string.IsNullOrWhiteSpace(ea1.endTime)) { } else { textAtEndTime.Text = ea1.endTime; textAtTotalHr.Text = ea1.hoursWorked.ToString(); textAtExtraHr.Text = ea1.extraHours.ToString(); } } else { MessageBox.Show("No record found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } transport1 = ea1; } catch (Exception es) { throw; } }