예제 #1
0
        public void ReadEvent()
        {
            if (!Validate())
            {
                return;
            }
            ReadDataHistory readHistory = _IAttendanceReadDataFacade.GetLastReadDataHistory(LoginUser);

            if (readHistory != null && readHistory.ReadResult == ReadDataResultType.Reading)
            {
                _View.ErrorMessage = "正在读取数据中请稍候再试!";
                return;
            }
            readHistory = new ReadDataHistory(DateTime.Now, ReadDataResultType.Reading, "");
            try
            {
                //增加此次读取记录,状态为读取中
                int readDataHistoryID = _IAttendanceReadDataFacade.InsertReadDataHistoryRecord(readHistory, LoginUser);
                //跟新显示
                ReadHistoryDataBind();
                //读取oa数据库的结果
                if (IsSetReadTime)
                {
                    _IAttendanceReadDataFacade.ReadDataFromAccessToSQL(readDataHistoryID, LoginUser, Convert.ToDateTime(_View.ReadFromTime), Convert.ToDateTime(_View.ReadToTime));
                }
                else
                {
                    _IAttendanceReadDataFacade.ReadDataFromAccessToSQL(readDataHistoryID, LoginUser);
                }
                //跟新显示
                ReadHistoryDataBind();
            }
            catch (Exception ae)
            {
                _View.ErrorMessage = ae.Message;
            }
        }
예제 #2
0
 public InsertReadDataHistory(ReadDataHistory history, IReadDataHistory historyMock, Account loginUser)
 {
     _LoginUser  = loginUser;
     _History    = history;
     _DalHistory = historyMock;
 }
예제 #3
0
 public InsertReadDataHistory(ReadDataHistory history, Account loginUser)
 {
     _LoginUser = loginUser;
     _History   = history;
 }
예제 #4
0
 public void SystemReadDataFromAccessToSQL(ReadDataHistory readNewHistory, Account loginUser)
 {
     new ReadDataFromAccess(loginUser).SystemReadDataFromAccessToSQL(readNewHistory);
 }