Beispiel #1
0
 public DbQueryResult GetLogs(OperationLogQuery query)
 {
     StringBuilder builder = new StringBuilder();
     Pagination page = query.Page;
     if (query.FromDate.HasValue)
     {
         builder.AppendFormat("AddedTime >= '{0}'", DataHelper.GetSafeDateTimeFormat(query.FromDate.Value));
     }
     if (query.ToDate.HasValue)
     {
         if (!string.IsNullOrEmpty(builder.ToString()))
         {
             builder.Append(" AND");
         }
         builder.AppendFormat(" AddedTime <= '{0}'", DataHelper.GetSafeDateTimeFormat(query.ToDate.Value));
     }
     if (!string.IsNullOrEmpty(query.OperationUserName))
     {
         if (!string.IsNullOrEmpty(builder.ToString()))
         {
             builder.Append(" AND");
         }
         builder.AppendFormat(" UserName = '******'", DataHelper.CleanSearchString(query.OperationUserName));
     }
     return DataHelper.PagingByTopsort(page.PageIndex, page.PageSize, page.SortBy, page.SortOrder, page.IsCount, "Hishop_Logs", "LogId", builder.ToString(), "*");
 }
Beispiel #2
0
 private OperationLogQuery GetOperationLogQuery()
 {
     OperationLogQuery query = new OperationLogQuery();
     if (!string.IsNullOrEmpty(Page.Request.QueryString["OperationUserName"]))
     {
         query.OperationUserName = base.Server.UrlDecode(Page.Request.QueryString["OperationUserName"]);
     }
     if (!string.IsNullOrEmpty(Page.Request.QueryString["FromDate"]))
     {
         query.FromDate = new DateTime?(Convert.ToDateTime(Page.Request.QueryString["FromDate"]));
     }
     if (!string.IsNullOrEmpty(Page.Request.QueryString["ToDate"]))
     {
         query.ToDate = new DateTime?(Convert.ToDateTime(Page.Request.QueryString["ToDate"]));
     }
     query.Page.PageIndex = pager.PageIndex;
     query.Page.PageSize = pager.PageSize;
     if (!string.IsNullOrEmpty(Page.Request.QueryString["SortBy"]))
     {
         query.Page.SortBy = Page.Request.QueryString["SortBy"];
     }
     if (!string.IsNullOrEmpty(Page.Request.QueryString["SortOrder"]))
     {
         query.Page.SortOrder = SortAction.Desc;
     }
     return query;
 }
Beispiel #3
0
 public static DbQueryResult GetLogs(OperationLogQuery query)
 {
     return new LogDao().GetLogs(query);
 }
Beispiel #4
0
 public abstract DbQueryResult GetLogs(OperationLogQuery query);
Beispiel #5
0
 public static DbQueryResult GetLogs(OperationLogQuery query)
 {
     return StoreProvider.Instance().GetLogs(query);
 }