コード例 #1
0
 protected override void ExcuteSelf()
 {
     try
     {
         using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
         {
             _IRecord.UpdatetAttendanceInAndOutRecord(_Employee);
             //插入日志
             _InsertLog.Excute();
             //计算考勤
             List <AttendanceInAndOutRecord> records =
                 _Employee.EmployeeAttendance.AttendanceInAndOutRecordList.FindAll(FindAttendanceInAndOutRecord);
             _Employee.EmployeeAttendance.AttendanceInAndOutRecordList = records;
             //updateEmployeeAttendance.UpdateEmployeeDayAttendance(_Employee, _TheDate);
             ts.Complete();
         }
     }
     catch
     {
         BllUtility.ThrowException(BllExceptionConst._DbError);
     }
 }
コード例 #2
0
        protected override void ExcuteSelf()
        {
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    //更新员工进出信息
                    _Employee.EmployeeAttendance.RemoveInAndOutRecordByRecordId(_Record.RecordID);
                    _Employee.EmployeeAttendance.AttendanceInAndOutRecordList.Add(_Record);
                    _IRecord.UpdatetAttendanceInAndOutRecord(_Employee);
                    //插入日志
                    _InsertLog.Excute();

                    //计算考勤
                    List <AttendanceInAndOutRecord> allRecords;
                    List <AttendanceInAndOutRecord> records =
                        _Employee.EmployeeAttendance.AttendanceInAndOutRecordList.FindAll(
                            FindOldAttendanceInAndOutRecord);
                    allRecords = records;
                    if (!_TheDate.Date.Equals(_OldDate.Date))
                    {
                        records =
                            _Employee.EmployeeAttendance.AttendanceInAndOutRecordList.FindAll(
                                FindNewAttendanceInAndOutRecord);
                        allRecords.AddRange(records);
                    }
                    _Employee.EmployeeAttendance.AttendanceInAndOutRecordList = allRecords;
                    //updateEmployeeAttendance.UpdateEmployeeDayAttendanceWithOld(_Employee, _TheDate, _OldDate);

                    ts.Complete();
                }
            }
            catch
            {
                BllUtility.ThrowException(BllExceptionConst._DbError);
            }
        }