private bool AddJobCardDataToDatabase(string _empDate, int _empID, DateTime _currentDate, int _userID,JobCardApp jcApp)
 {
     bool check = false;
     try
     {
         JobCardEmp _jobCardEmp = new JobCardEmp();
         _jobCardEmp.EmpDate = _empDate;
         _jobCardEmp.EmpID = _empID;
         _jobCardEmp.Dated = _currentDate;
         _jobCardEmp.SubmittedFrom = _userID;
         _jobCardEmp.WrkCardID = jcApp.CardType;
         _jobCardEmp.DateCreated = DateTime.Now;
         _jobCardEmp.WorkMin = jcApp.WorkMin;
         _jobCardEmp.JCAppID = jcApp.JobCardID;
         _jobCardEmp.OtherValue = jcApp.OtherValue;
         db.JobCardEmps.Add(_jobCardEmp);
         if (db.SaveChanges() > 0)
         {
             check= true;
         }
     }
     catch (Exception ex)
     {
         check = false;
     }
     return check;
 }
        private void AddJobCardToDatabase(string _empDate, int _empID, DateTime _currentDate, int _userID, short _WorkCardID, short _CompID, DateTime dateTime)
        {
            JobCardEmp _jobCardEmp = new JobCardEmp();
            _jobCardEmp.EmpDate = _empDate;
            _jobCardEmp.EmpID = _empID;
            _jobCardEmp.Dated = _currentDate;
            _jobCardEmp.SubmittedFrom = _userID;
            _jobCardEmp.WrkCardID = _WorkCardID;
            _jobCardEmp.CompanyID = _CompID;
            _jobCardEmp.DateCreated = dateTime;
            db.JobCardEmps.Add(_jobCardEmp);
            db.SaveChanges();

            // ToDo  ===== check for already processed Attendance
        }
 private void RemoveFromAttData(JobCardEmp item)
 {
     try
     {
         DateTime date = item.Dated.Value;
         List<Emp> emp = db.Emps.Where(aa => aa.EmpID == item.EmpID).ToList();
         ManualProcess mp = new ManualProcess();
         mp.ManualProcessAttendance(date, emp);
     }
     catch (Exception ex)
     {
     }
 }
 private bool AddJobCardDataToDatabase(string _empDate, int _empID, DateTime _currentDate, int _userID, short _WorkCardID, short _CompID, DateTime dateTime)
 {
     bool check = false;
     try
     {
         JobCardEmp _jobCardEmp = new JobCardEmp();
         _jobCardEmp.EmpDate = _empDate;
         _jobCardEmp.EmpID = _empID;
         _jobCardEmp.Dated = _currentDate;
         _jobCardEmp.SubmittedFrom = _userID;
         _jobCardEmp.WrkCardID = _WorkCardID;
         _jobCardEmp.CompanyID = _CompID;
         _jobCardEmp.DateCreated = dateTime;
         db.JobCardEmps.Add(_jobCardEmp);
         if (db.SaveChanges() > 0)
         {
             check= true;
         }
     }
     catch (Exception ex)
     {
         check = false;
     }
     return check;
 }