/DocSrvQuartz_V2/DocSrv.Core/DaExcelSrvStatus.cs
http://sgsoft-las.googlecode.com/ · C# · 76 lines · 59 code · 9 blank · 8 comment · 1 complexity · 89c97b7fb2adaf57368d5734cf569e02 MD5 · raw file
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Data;
- using System.Globalization;
- using System.Text;
- using System.Data.Common;
- using Microsoft.Practices.EnterpriseLibrary.Data;
- using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
-
- using DocSrv.Model;
-
-
- namespace DocSrv.Dal
- {
- public partial class DaExcelSrvStatus
- {
- internal const int MAX_DESCRIPTION_LEN = 500;
- /// <summary>
- /// ???????JOB????????????1.
- /// 0???????????1???????2??????????
- /// 1000--1999?????Excel????????1001??????
- /// </summary>
- /// <returns></returns>
- public int ClearInterruptedJobStatus()
- {
- //???????????
- try
- {
- return DeleteByWhereClause(" WHERE RC%10 <>0"); //????0????
- }
- catch (DbException ex)
- {
- throw new DalException("??????????????!",ex);
- }
- }
-
-
- public int ClearInterruptedJobStatus(int beginStatus, int endStatus)
- {
- //???????????
- try
- {
- return DeleteByWhereClause(String.Format(" WHERE RC>{0} AND RC<{1} ",beginStatus,endStatus));
- }
- catch (DbException ex)
- {
- throw new DalException("??????????????!", ex);
- }
- }
-
- public int ClearInterruptedExcelJobStatus()
- {
- return ClearInterruptedJobStatus(1000, 1999);
- }
-
-
- public void SafeUpdate(string file_id, int status_code, string opt_info)
- {
- try
- {
- if (opt_info.Length > MAX_DESCRIPTION_LEN)
- {
- opt_info = opt_info.Substring(0, MAX_DESCRIPTION_LEN);
- }
- Update(new MoExcelSrvStatus(file_id, status_code, DateTime.Now, opt_info));
- }
- catch (DalException ex)
- {
- log.Error(String.Format("????{0}??????.", file_id), ex);
- }
- }
-
- }
- }