Beispiel #1
0
    private void SetObjectInfo(EmployeeAttendanceMaster _objvEmployeeAttendanceMaster)
    {
        try
        {
            _objEmployeeAttendanceMaster.EmployeeId = Convert.ToInt64(lblEmpId.Text);
            if (btnMarkin.Text.ToUpper() == "MARKIN")
            {
                _objEmployeeAttendanceMaster.MarkInRemark = txtRemarks.Text;
                _objEmployeeAttendanceMaster.CreatedBy    = Session["LoginId"].ToString();

                _objEmployeeAttendanceMaster.MarkInDate      = txtDate.Text;
                _objEmployeeAttendanceMaster.MarkIntime      = txtTime.Text;
                _objEmployeeAttendanceMaster.AlertMessasg    = lblAlertMsg.Text;
                _objEmployeeAttendanceMaster.MarkInIPAddress = GetIP();
            }
            else
            {
                _objEmployeeAttendanceMaster.MarkOutDate      = txtDate.Text;
                _objEmployeeAttendanceMaster.MarkOutTime      = txtTime.Text;
                _objEmployeeAttendanceMaster.MarkoutRemark    = txtRemarks.Text;
                _objEmployeeAttendanceMaster.ModifiedBy       = Session["LoginId"].ToString();
                _objEmployeeAttendanceMaster.MarkOutIPAddress = GetIP();
            }
        }
        catch (Exception ee)
        {
            lblMsg.Text      = ee.StackTrace;
            lblMsg.ForeColor = Color.Red;
        }
    }
    public ICollection <EmployeeAttendanceMaster> SetObjectInfoCollection()
    {
        List <EmployeeAttendanceMaster> lst = new List <EmployeeAttendanceMaster>();
        string EmployeeId = Session["EmployeeId"].ToString();
        EmployeeAttendanceMaster _objEmployeeAttendanceMaster = null;

        for (int i = 0; i < grdMonthlyAttendanceSummary.Rows.Count; i++)
        {
            CheckBox chk = (CheckBox)grdMonthlyAttendanceSummary.Rows[i].FindControl("chk_Date");
            TextBox  UpdatedMarkinTime  = (TextBox)grdMonthlyAttendanceSummary.Rows[i].FindControl("txt_UpdatedMarkInTime");
            TextBox  UpdatedMarkOutTime = (TextBox)grdMonthlyAttendanceSummary.Rows[i].FindControl("txt_UpdatedMarkOutTime");
            //string EmployeeId = Session["EmployeeId"].ToString();
            //string atr = chk.Checked.ToString();
            if (chk.Checked == true && UpdatedMarkinTime.Enabled == true && UpdatedMarkOutTime.Enabled == true)
            {
                _objEmployeeAttendanceMaster            = new EmployeeAttendanceMaster();
                _objEmployeeAttendanceMaster.EmployeeId = Convert.ToInt64(Session["EmployeeId"].ToString());
                //_objEmployeeAttendanceMaster.EmployeeId = 2;
                // _objEmployeeAttendanceMaster.EmployeeId = Convert.ToInt64(txtCode.Text);
                _objEmployeeAttendanceMaster.UpdatedMarkInTime   = UpdatedMarkinTime.Text;
                _objEmployeeAttendanceMaster.UpdatedMarkOutTime  = UpdatedMarkOutTime.Text;
                _objEmployeeAttendanceMaster.IsSubmitted         = true;
                _objEmployeeAttendanceMaster.SubmittedBy         = Session["LoginId"].ToString();
                _objEmployeeAttendanceMaster.SubmittedDate       = DateTime.Now.ToString();
                _objEmployeeAttendanceMaster.MarkInDate          = chk.Text;
                _objEmployeeAttendanceMaster.MarkOutDate         = chk.Text;
                _objEmployeeAttendanceMaster.AlertMessasg        = "Request for Attendance Approval";
                _objEmployeeAttendanceMaster.MarkOutAlertMessasg = "Request for Attendance Approval";
                _objEmployeeAttendanceMaster.CreatedBy           = Session["LoginId"].ToString();
                _objEmployeeAttendanceMaster.CreatedDate         = DateTime.Now.ToString();
                lst.Add(_objEmployeeAttendanceMaster);
            }
        }
        return(lst);
    }
Beispiel #3
0
    public ICollection <EmployeeAttendanceMaster> SetObjectInfoCollection()
    {
        List <EmployeeAttendanceMaster> lst = new List <EmployeeAttendanceMaster>();
        string EmployeeId = Session["EmployeeId"].ToString();
        EmployeeAttendanceMaster _objEmployeeAttendanceMaster = null;

        for (int i = 0; i < gdvPendingAttendanse.Rows.Count; i++)
        {
            TextBox         AttendanceDate = (TextBox)gdvPendingAttendanse.Rows[i].FindControl("txtAttendanceDate");
            CheckBox        chk            = (CheckBox)gdvPendingAttendanse.Rows[i].FindControl("chkSelect");
            TextBox         MarkinTime     = (TextBox)gdvPendingAttendanse.Rows[i].FindControl("txtMarkinTime");
            TextBox         MarkOutTime    = (TextBox)gdvPendingAttendanse.Rows[i].FindControl("txtMarkOutTime");
            RadioButtonList isApprove      = (RadioButtonList)gdvPendingAttendanse.Rows[i].FindControl("rblApproveDisApprove");
            TextBox         Remark         = (TextBox)gdvPendingAttendanse.Rows[i].FindControl("txtRemark");
            HiddenField     AttendanceId   = (HiddenField)gdvPendingAttendanse.Rows[i].FindControl("hdnAttendanceId");


            if (chk.Checked == true)
            {
                _objEmployeeAttendanceMaster = new EmployeeAttendanceMaster();

                DataTable _dt = _objEmployeeAttendanceMasterManager.GetEmployeeAttendanceById(Convert.ToInt64(AttendanceId.Value)).Tables[0];
                _objEmployeeAttendanceMaster.SetObjectInfo(_dt.Rows[0]);
                _objEmployeeAttendanceMaster.AttendanceId = Convert.ToInt32(AttendanceId.Value);
                // _objEmployeeAttendanceMaster.EmployeeId = Convert.ToInt64(Session["EmployeeId"].ToString());
                _objEmployeeAttendanceMaster.MarkIntime     = MarkinTime.Text;
                _objEmployeeAttendanceMaster.ApprovalRemark = Remark.Text;
                _objEmployeeAttendanceMaster.MarkOutTime    = MarkOutTime.Text;
                if (isApprove.SelectedValue == "Approve")
                {
                    _objEmployeeAttendanceMaster.IsApprived          = 1;
                    _objEmployeeAttendanceMaster.AlertMessasg        = "";
                    _objEmployeeAttendanceMaster.MarkOutAlertMessasg = "";
                }
                else
                {
                    _objEmployeeAttendanceMaster.IsApprived          = 0;
                    _objEmployeeAttendanceMaster.AlertMessasg        = "DisApprove";
                    _objEmployeeAttendanceMaster.MarkOutAlertMessasg = "DisApprove";
                }
                _objEmployeeAttendanceMaster.IsSubmitted  = true;
                _objEmployeeAttendanceMaster.ApprovedBy   = Session["LoginId"].ToString();
                _objEmployeeAttendanceMaster.ApprovedDate = DateTime.Now.ToString();
                //  _objEmployeeAttendanceMaster.AlertMessasg = "";
                // _objEmployeeAttendanceMaster.MarkOutAlertMessasg = "";
                _objEmployeeAttendanceMaster.ApprovalRemark = Remark.Text;
                _objEmployeeAttendanceMaster.MarkInDate     = AttendanceDate.Text;
                _objEmployeeAttendanceMaster.MarkOutDate    = AttendanceDate.Text;
                lst.Add(_objEmployeeAttendanceMaster);
            }
        }
        return(lst);
    }