Beispiel #1
0
        internal object InsertAttendance(tbl_EmplyoeeAttendance atbl_EmplyoeeAttendance)
        {
            //foreach (tbl_EmplyoeeAttendance atten in lsttbl_EmplyoeeAttendance)
            //{
            _context.tbl_EmplyoeeAttendance.Add(atbl_EmplyoeeAttendance);
            _context.SaveChanges();
            //}

            return(1);
        }
        protected void btnConfirm_Click(object sender, EventArgs e)
        {
            if (dgvEmployee.Rows.Count == 0)
            {
                lblMessage.Text = "No employee in the list!";
            }

            List <tbl_EmplyoeeAttendance> lsttbl_EmplyoeeAttendance = new List <tbl_EmplyoeeAttendance>();
            tbl_EmplyoeeAttendance        atbl_EmplyoeeAttendance   = new tbl_EmplyoeeAttendance();

            foreach (GridViewRow gvRow in dgvEmployee.Rows)
            {
                Label lblEid = ((Label)gvRow.FindControl("lblEid"));
                atbl_EmplyoeeAttendance.EID = lblEid.Text;

                TextBox txtbxIntime = ((TextBox)gvRow.FindControl("txtbxIntime"));
                atbl_EmplyoeeAttendance.In_Time = TimeSpan.Parse(txtbxIntime.Text);

                TextBox txtbxOuttime = ((TextBox)gvRow.FindControl("txtbxOuttime"));
                atbl_EmplyoeeAttendance.Out_Time = TimeSpan.Parse(txtbxOuttime.Text);

                atbl_EmplyoeeAttendance.Attendance_Date = Convert.ToDateTime(txtAttendanceDate.Text);

                //TimeSpan intime = TimeSpan.Parse(txtIntime.Text);
                //atbl_EmplyoeeAttendance.In_time = TimeSpan.Parse(txtIntime.Text);
                //atbl_EmplyoeeAttendance.Out_Time = TimeSpan.Parse(txtOuttime.Text);
                atbl_EmplyoeeAttendance.Edit_Date = DateTime.Now;

                aAttendance_BLL.InsertAttendance(atbl_EmplyoeeAttendance);
            }

            //lsttbl_EmplyoeeAttendance.Add(atbl_EmplyoeeAttendance);

            lblMessage.Visible = true;
            lblMessage.Text    = "Data Save Successfully";
        }
 internal object InsertAttendance(tbl_EmplyoeeAttendance atbl_EmplyoeeAttendance)
 {
     return(aAttendance_DAL.InsertAttendance(atbl_EmplyoeeAttendance));
 }