コード例 #1
0
ファイル: CMSService.cs プロジェクト: jorzen2010/SkyWebCMS
        public static Pager SelectAll(string DtoName, Pager pager)
        {
            IMapping Mapping = MappingFactory.CreatMapping(DtoName);

            pager=CommonDal.GetPager(pager);
            return pager;
        }
コード例 #2
0
ファイル: Problems.cs プロジェクト: lujw/MVCQuestionOnlineGIT
        public Pager GetReplyPaging(Pager pager, int cid, string sort = "", string order = "desc", string user = "")
        {
            IQueryable<Pts_Problems> query = db.Pts_Problems ;
            if (cid > 0)
            {
                query = query.Where(m => m.CategoryID == cid);
            }
            switch (sort)
            {
                case "NewQuestion":
                    query = query.Where(m => m.IsStart==true);
                    break;
                case "MyReplay":
                    query = query.Where(m => m.HandlingUser == user);
                    break;
                case "SolvedQuestion":
                    query = query.Where(m => m.IsClosed == true);
                    break;
                case "MySolvedQuestion":
                    query = query.Where(m => m.SolveUser == user);
                    break;
                default :
                    break;
            }
            pager.Amount = query.Count();

            if (order == "desc")
                query = query.OrderByDescending(m => m.CreateTime);
            else
                query = query.OrderBy(m => m.CreateTime);

            query = query.Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #3
0
ファイル: UserClassBll.cs プロジェクト: jorzen2010/HealthCrm
        public static Pager GetUserClassPager(Pager pager,string strwhere,string table)
        {


            //return UserClassDal.GetUserClassPage(pager, strwhere,table);
            return UserClassDal.GetUserClassPage(pager, strwhere, table);
        }
コード例 #4
0
ファイル: HealthBll.cs プロジェクト: jorzen2010/HealthCrm
        public static Pager GetHealthPager(Pager pager,string strwhere,string table)
        {


            //return HealthDal.GetHealthPage(pager, strwhere,table);
            return HealthDal.GetHealthPage(pager, strwhere, table);
        }
コード例 #5
0
        /// <summary>
        /// 获取指定日期归档文章
        /// </summary>
        public Pager GetArchivesArticlePaging(Pager pager, int tid, int year, int month)
        {
            IQueryable<blog_varticle> query = GetArticles(tid, 0, 0).Where(m => m.createdate.Year == year && m.createdate.Month == month);

            pager.Amount = query.Count();
            query = query.OrderByDescending(m => m.id).Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #6
0
ファイル: Problems.cs プロジェクト: lujw/MVCQuestionOnlineGIT
        /// <summary>
        /// 获取问题记录
        /// </summary>
        /// <param name="pager"></param>
        /// <param name="tid"></param>
        /// <param name="cids"></param>
        /// <param name="layer"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        public Pager GetReplyPaging(Pager pager, string cids, string sort = "", string order = "desc", string user = "")
        {
            IQueryable<Pts_Problems> query = db.Pts_Problems;
            if (cids != "")
            {
                List<int> listids = new List<string>(cids.Split(',')).ConvertAll(i => int.Parse(i));
                query = query.Where(m => listids.Contains(m.CategoryID));
            }
            switch (sort)
            {
                case "NewQuestion":
                    query = query.Where(m => m.IsStart == true);
                    break;
                case "MyReplay":
                    query = query.Where(m => m.HandlingUser == user);
                    break;
                case "SolvedQuestion":
                    query = query.Where(m => m.IsClosed == true);
                    break;
                case "MySolvedQuestion":
                    query = query.Where(m => m.SolveUser == user);
                    break;
                default:
                    break;
            }
            pager.Amount = query.Count();

            if (order == "desc")
                query = query.OrderByDescending(m => m.ProblemID);
            else
                query = query.OrderBy(m => m.ProblemID);

            query = query.Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #7
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Pages\FetchedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(),
            Subtitle = "Fetched jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") },
                    { Queue.ToUpperInvariant(), Request.LinkTo("/queues/" + Queue) }
                },
            BreadcrumbsTitle = "Fetched jobs",    
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FetchedJobDto> fetchedJobs;
    
    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FetchedCount(Queue))
        {
            BasePageUrl = Request.LinkTo("/queues/fetched/" + Queue)
        };

        fetchedJobs = monitor
            .FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 43 "..\..\Pages\FetchedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");


            
            #line 48 "..\..\Pages\FetchedJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 51 "..\..\Pages\FetchedJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 51 "..\..\Pages\FetchedJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral(@"    <table class=""table"">
        <thead>
            <tr>
                <th>Id</th>
                <th>State</th>
                <th>Job</th>
                <th>Created</th>
                <th>Fetched</th>
            </tr>
        </thead>
        <tbody>
");


            
            #line 64 "..\..\Pages\FetchedJobsPage.cshtml"
             foreach (var job in fetchedJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr>\r\n                    <td>\r\n                        <a href=\"" +
"");


            
            #line 68 "..\..\Pages\FetchedJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 68 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n                    </td>\r\n                    <td>\r\n                      " +
"  <span class=\"label label-default\" style=\"");


            
            #line 71 "..\..\Pages\FetchedJobsPage.cshtml"
                                                             Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 72 "..\..\Pages\FetchedJobsPage.cshtml"
                       Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("</span>\r\n                    </td>\r\n                    <td>\r\n                   " +
"     <span title=\"");


            
            #line 75 "..\..\Pages\FetchedJobsPage.cshtml"
                                Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 76 "..\..\Pages\FetchedJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n");


            
            #line 80 "..\..\Pages\FetchedJobsPage.cshtml"
                         if (job.Value.CreatedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 82 "..\..\Pages\FetchedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.CreatedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 83 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(job.Value.CreatedAt);

            
            #line default
            #line hidden
WriteLiteral(" \r\n                            </span>\r\n");


            
            #line 85 "..\..\Pages\FetchedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 88 "..\..\Pages\FetchedJobsPage.cshtml"
                         if (job.Value.FetchedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 90 "..\..\Pages\FetchedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.FetchedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 91 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(job.Value.FetchedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 93 "..\..\Pages\FetchedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 96 "..\..\Pages\FetchedJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 99 "..\..\Pages\FetchedJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 100 "..\..\Pages\FetchedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 100 "..\..\Pages\FetchedJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
コード例 #8
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Pages\FetchedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(),
            Subtitle = "Fetched jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") },
                    { Queue.ToUpperInvariant(), Request.LinkTo("/queues/" + Queue) }
                },
            BreadcrumbsTitle = "Fetched jobs",
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FetchedJobDto> fetchedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FetchedCount(Queue))
        {
            BasePageUrl = Request.LinkTo("/queues/fetched/" + Queue)
        };

        fetchedJobs = monitor
            .FetchedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 43 "..\..\Pages\FetchedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");


            
            #line 48 "..\..\Pages\FetchedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 54 "..\..\Pages\FetchedJobsPage.cshtml"
                         Write(Request.LinkTo("/enqueued/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 61 "..\..\Pages\FetchedJobsPage.cshtml"
                         Write(Request.LinkTo("/enqueued/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 68 "..\..\Pages\FetchedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">State</th>
                    <th>Job</th>
                    <th class=""align-right"">Fetched</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 84 "..\..\Pages\FetchedJobsPage.cshtml"
                 foreach (var job in fetchedJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row hover\">\r\n                        " +
"<td>\r\n                            <input type=\"checkbox\" class=\"js-jobs-list-che" +
"ckbox\" name=\"jobs[]\" value=\"");


            
            #line 88 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n                        </td>\r\n                        <td class=\"min-width" +
"\">\r\n                            <a href=\"");


            
            #line 91 "..\..\Pages\FetchedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 91 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                    Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n                        </td>\r\n                        <td class=\"min-width" +
"\">\r\n                            <span class=\"label label-default\" style=\"");


            
            #line 94 "..\..\Pages\FetchedJobsPage.cshtml"
                                                                 Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 95 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n                        </td>\r\n           " +
"             <td>\r\n                            <a class=\"job-method\" href=\"");


            
            #line 99 "..\..\Pages\FetchedJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 100 "..\..\Pages\FetchedJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n                        </td>\r\n              " +
"          <td class=\"align-right\">\r\n");


            
            #line 104 "..\..\Pages\FetchedJobsPage.cshtml"
                             if (job.Value.FetchedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 106 "..\..\Pages\FetchedJobsPage.cshtml"
                                              Write(JobHelper.ToStringTimestamp(job.Value.FetchedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 107 "..\..\Pages\FetchedJobsPage.cshtml"
                               Write(job.Value.FetchedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 109 "..\..\Pages\FetchedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 112 "..\..\Pages\FetchedJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 116 "..\..\Pages\FetchedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 116 "..\..\Pages\FetchedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 116 "..\..\Pages\FetchedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #9
0
 public static Pager GetArticlePager(Pager pager,string strwhere,string table)
 {
     //return ArticleDal.GetArticlePage(pager, strwhere,table);
     return ArticleDal.GetArticlePage(pager, strwhere, table);
 }
コード例 #10
0
ファイル: CommonDal.cs プロジェクト: jorzen2010/SkyWebCMS
        public static Pager GetPager(Pager pager)
        {
            SqlParameter[] arParms = new SqlParameter[9];
            //@tbname   --要分页显示的表名
            arParms[0] = new SqlParameter("@tbname", SqlDbType.NVarChar, 30);
            arParms[0].Value = pager.table;

            // @FieldKey --用于定位记录的主键(惟一键)字段,可以是逗号分隔的多个字段
            arParms[1] = new SqlParameter("@FieldKey", SqlDbType.NVarChar, 40);
            arParms[1].Value = pager.FieldKey;

            //@PageCurrent --要显示的页码
            arParms[2] = new SqlParameter("@PageCurrent", SqlDbType.Int);
            arParms[2].Value = pager.PageNo + 1;

            // @PageSize --每页的大小(记录数)
            arParms[3] = new SqlParameter("@PageSize", SqlDbType.Int);
            arParms[3].Value = pager.PageSize;

            //@FieldShow  --以逗号分隔的要显示的字段列表,如果不指定,则显示所有字段
            arParms[4] = new SqlParameter("@FieldShow", SqlDbType.NVarChar, 500);
            arParms[4].Value = pager.FiledShow;

            //@FieldOrder --以逗号分隔的排序字段列表,可以指定在字段后面指定DESC/ASC用于指定排序顺序

            arParms[5] = new SqlParameter("@FieldOrder", SqlDbType.NVarChar, 500);
            arParms[5].Value = pager.FiledOrder;

            //@Where   --查询条件
            arParms[6] = new SqlParameter("@Where", SqlDbType.VarChar, 8000);
            arParms[6].Value = pager.strwhere;

            //@PageCount --总页数
            arParms[7] = new SqlParameter("@PageCount", SqlDbType.Int);
            arParms[7].Direction = ParameterDirection.Output;

            //@RecordCount --总记录数
            arParms[8] = new SqlParameter("@RecordCount", SqlDbType.Int);
            arParms[8].Direction = ParameterDirection.Output;
            SqlConnection myconn = new SqlConnection(CommonDal.ConnectionString);
            try
            {

                DataTable dt = null;
                DataSet ds = SqlHelper.ExecuteDataset(myconn, CommandType.StoredProcedure, "sp_AspNetPageView", arParms);
                dt = ds.Tables[0];

                var totalItems = (int)arParms[8].Value;

                pager.Amount = totalItems;
                pager.EntityDataTable = dt;
                pager.PageCount = (int)arParms[7].Value;

                return pager;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {

                myconn.Close();
                myconn.Dispose();
            }
        }
コード例 #11
0
        public override void Execute()
        {


WriteLiteral("\r\n");









            
            #line 9 "..\..\Pages\SucceededJobs.cshtml"
  
    Layout = new LayoutPage { Title = "Succeeded Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<SucceededJobDto> succeededJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.SucceededListCount())
        {
            BasePageUrl = Request.LinkTo("/succeeded")
        };

        succeededJobs = monitor
            .SucceededJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 32 "..\..\Pages\SucceededJobs.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No succeeded jobs found.\r\n    </div>\r" +
"\n");


            
            #line 37 "..\..\Pages\SucceededJobs.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 40 "..\..\Pages\SucceededJobs.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 40 "..\..\Pages\SucceededJobs.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Job</th>\r\n                <th>Succeeded</th>\r\n    " +
"        </tr>\r\n        </thead>\r\n        <tbody>\r\n");


            
            #line 51 "..\..\Pages\SucceededJobs.cshtml"
             foreach (var job in succeededJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 53 "..\..\Pages\SucceededJobs.cshtml"
                       Write(job.Value != null && !job.Value.InSucceededState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n                        <a href=\"");


            
            #line 55 "..\..\Pages\SucceededJobs.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 56 "..\..\Pages\SucceededJobs.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 58 "..\..\Pages\SucceededJobs.cshtml"
                         if (job.Value != null && !job.Value.InSucceededState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 61 "..\..\Pages\SucceededJobs.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n\r\n");


            
            #line 64 "..\..\Pages\SucceededJobs.cshtml"
                     if (job.Value == null)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <td colspan=\"3\"><em>Job was expired.</em>\r\n              " +
"          </td>\r\n");


            
            #line 68 "..\..\Pages\SucceededJobs.cshtml"
                    }
                    else
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <td>\r\n                            <span title=\"");


            
            #line 72 "..\..\Pages\SucceededJobs.cshtml"
                                    Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 73 "..\..\Pages\SucceededJobs.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("    \r\n                            </span>\r\n                        </td>\r\n");



WriteLiteral("                        <td>\r\n");


            
            #line 77 "..\..\Pages\SucceededJobs.cshtml"
                             if (job.Value.SucceededAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span  data-moment=\"");


            
            #line 79 "..\..\Pages\SucceededJobs.cshtml"
                                               Write(JobHelper.ToStringTimestamp(job.Value.SucceededAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 80 "..\..\Pages\SucceededJobs.cshtml"
                               Write(job.Value.SucceededAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 82 "..\..\Pages\SucceededJobs.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n");


            
            #line 84 "..\..\Pages\SucceededJobs.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </tr>\r\n");


            
            #line 86 "..\..\Pages\SucceededJobs.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 89 "..\..\Pages\SucceededJobs.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 90 "..\..\Pages\SucceededJobs.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 90 "..\..\Pages\SucceededJobs.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
コード例 #12
0
 /// <summary>
 /// 获取评论所在页码
 /// </summary>
 public int GetCommentPageNo(int pagesize, int parentid, int floor, int ordertype = 1)
 {
     Pager pager = new Pager();
     pager.PageSize = pagesize;
     IQueryable<blog_article> query = GetArticlesViaStatus().Where(m => m.parentid == parentid);
     if (ordertype == 1)
         query = query.Where(m => m.orderid <= floor);
     else
         query = query.Where(m => m.orderid >= floor);
     pager.Amount = query.Count();
     return pager.PageCount;
 }
コード例 #13
0
        public override void Execute()
        {


WriteLiteral("\n");










            
            #line 10 "..\..\Pages\EnqueuedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(),
            Subtitle = "Enqueued jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") }
                }
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue))
    {
        BasePageUrl = Request.LinkTo("/queues/" + Queue)
    };

    JobList<EnqueuedJobDto> enqueuedJobs = monitor
        .EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\n");


            
            #line 36 "..\..\Pages\EnqueuedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\n        The queue is empty.\n    </div>\n");


            
            #line 41 "..\..\Pages\EnqueuedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
"            <button class=\"js-jobs-list-command btn btn-sm btn-default\"\n        " +
"            data-url=\"");


            
            #line 47 "..\..\Pages\EnqueuedJobsPage.cshtml"
                         Write(Request.LinkTo("/enqueued/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 54 "..\..\Pages\EnqueuedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">State</th>
                    <th>Job</th>
                    <th class=""align-right"">Enqueued</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 70 "..\..\Pages\EnqueuedJobsPage.cshtml"
                 foreach (var job in enqueuedJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row hover ");


            
            #line 72 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                  Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                        <td>\n                            <input type=\"checkbox" +
"\" class=\"js-jobs-list-checkbox\" name=\"jobs[]\" value=\"");


            
            #line 74 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\n                        </td>\n                        <td class=\"min-width\">" +
"\n                            <a href=\"");


            
            #line 77 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 78 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n");


            
            #line 80 "..\..\Pages\EnqueuedJobsPage.cshtml"
                             if (!job.Value.InEnqueuedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");


            
            #line 83 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        <span class=\"label label-default\" style=\"");


            
            #line 86 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                                 Write(JobHistoryRenderer.ForegroundStateColors.ContainsKey(job.Value.State) ? String.Format("background-color: {0};", JobHistoryRenderer.ForegroundStateColors[job.Value.State]) : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 87 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(job.Value.State);

            
            #line default
            #line hidden
WriteLiteral("\n                            </span>\n                        </td>\n              " +
"          <td>\n                            <a class=\"job-method\" href=\"");


            
            #line 91 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 92 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n                        </td>\n                 " +
"       <td class=\"align-right\">\n");


            
            #line 96 "..\..\Pages\EnqueuedJobsPage.cshtml"
                             if (job.Value.EnqueuedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 98 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                    ");


            
            #line 99 "..\..\Pages\EnqueuedJobsPage.cshtml"
                               Write(job.Value.EnqueuedAt);

            
            #line default
            #line hidden
WriteLiteral("\n                                </span>\n");


            
            #line 101 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            }
                            else
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <em>n/a</em>\n");


            
            #line 105 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                    </tr>\n");


            
            #line 108 "..\..\Pages\EnqueuedJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\n        </table>\n    </div>\n");


            
            #line 112 "..\..\Pages\EnqueuedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 112 "..\..\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 112 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #14
0
ファイル: BbsServiceImpl.cs プロジェクト: 91mvc/YQCMS
 /// <summary>
 /// 论坛帖子信息分页(主题及其回复)
 /// </summary>
 public Pager GetPostPaging(Pager pager, int id)
 {
     IQueryable<cms_article> query = entity.cms_article.Where(m => m.articleid == id).Where(m => m.layer < 2);
     pager.Amount = query.Count();
     query = query.OrderBy(m => m.id).Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
     pager.Entity = query;
     return pager;
 }
コード例 #15
0
        /// <summary>
        /// 关键字搜索
        /// </summary>
        public Pager GetKeySearchPaging(Pager pager, int tid, string key)
        {
            IQueryable<blog_varticle> query = GetArticles(tid, 0, 0).Where(m =>
                                      (m.tags + m.title + m.summary).Contains(key) || m.content.Contains(key));

            pager.Amount = query.Count();
            query = query.OrderByDescending(m => m.id).Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #16
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Deleted Jobs" };

    int from, perPage;

    int.TryParse(Request.Query["from"], out from);
    int.TryParse(Request.Query["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.DeletedListCount())
    {
        BasePageUrl = Request.LinkTo("/deleted")
    };

    JobList<DeletedJobDto> jobs = monitor.DeletedJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 25 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No deleted jobs found.\r\n    </div>\r\n");


            
            #line 30 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 36 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                         Write(Request.LinkTo("/deleted/requeue"));

            
            #line default
            #line hidden
WriteLiteral("\"\r\n                    data-loading-text=\"Enqueueing...\">\r\n                <span " +
"class=\"glyphicon glyphicon-repeat\"></span>\r\n                Requeue jobs\r\n      " +
"      </button>\r\n            ");


            
            #line 41 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>
        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Job</th>
                    <th class=""align-right"">Deleted</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 55 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                 foreach (var job in jobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 57 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                            Write(job.Value != null && !job.Value.InDeletedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 57 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                                                                                       Write(job.Value != null && job.Value.InDeletedState && job.Value != null ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <td>\r\n");


            
            #line 59 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                             if (job.Value != null && job.Value.InDeletedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 61 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 62 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n  " +
"                          <a href=\"");


            
            #line 65 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 66 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n");


            
            #line 68 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                             if (job.Value != null && !job.Value.InDeletedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 71 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n\r\n");


            
            #line 74 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                         if (job.Value == null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <td colspan=\"2\">\r\n                                <em" +
">Job was expired.</em>\r\n                            </td>\r\n");


            
            #line 79 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        }
                        else
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <td>\r\n                                <a class=\"job-m" +
"ethod\" href=\"");


            
            #line 83 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                       Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 84 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </a>\r\n                            </td>\r\n");



WriteLiteral("                            <td class=\"align-right\">\r\n");


            
            #line 88 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                 if (job.Value.DeletedAt.HasValue)
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <span data-moment=\"");


            
            #line 90 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                                  Write(JobHelper.ToTimestamp(job.Value.DeletedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                        ");


            
            #line 91 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                   Write(job.Value.DeletedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </span>\r\n");


            
            #line 93 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </td>\r\n");


            
            #line 95 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </tr>\r\n");


            
            #line 97 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 101 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 101 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 101 "..\..\Dashboard\Pages\DeletedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #17
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Pages\FailedJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Failed Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FailedJobDto> failedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FailedCount())
        {
            BasePageUrl = Request.LinkTo("/failed")
        };

        failedJobs = monitor
            .FailedJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 31 "..\..\Pages\FailedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-success\">\r\n        You have no failed jobs at the mom" +
"ent.\r\n    </div>\r\n");


            
            #line 36 "..\..\Pages\FailedJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 42 "..\..\Pages\FailedJobsPage.cshtml"
                         Write(Request.LinkTo("/failed/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 49 "..\..\Pages\FailedJobsPage.cshtml"
                         Write(Request.LinkTo("/failed/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 56 "..\..\Pages\FailedJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table failed-table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Failed</th>
                    <th>Job</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 71 "..\..\Pages\FailedJobsPage.cshtml"
                   var index = 0; 

            
            #line default
            #line hidden

            
            #line 72 "..\..\Pages\FailedJobsPage.cshtml"
                 foreach (var job in failedJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                                            Write(!job.Value.InFailedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                                                                                                 Write(job.Value.InFailedState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <td rowspan=\"");


            
            #line 75 "..\..\Pages\FailedJobsPage.cshtml"
                                 Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n");


            
            #line 76 "..\..\Pages\FailedJobsPage.cshtml"
                             if (job.Value.InFailedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 78 "..\..\Pages\FailedJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 79 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"min-width\" rows" +
"pan=\"");


            
            #line 81 "..\..\Pages\FailedJobsPage.cshtml"
                                                   Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            <a href=\"");


            
            #line 82 "..\..\Pages\FailedJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 83 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </a>\r\n");


            
            #line 85 "..\..\Pages\FailedJobsPage.cshtml"
                             if (!job.Value.InFailedState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 88 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td class=\"min-width\">\r\n");


            
            #line 91 "..\..\Pages\FailedJobsPage.cshtml"
                             if (job.Value.FailedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 93 "..\..\Pages\FailedJobsPage.cshtml"
                                              Write(JobHelper.ToStringTimestamp(job.Value.FailedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 94 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.FailedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </span>\r\n");


            
            #line 96 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                        <td>\r\n                    " +
"        <div>\r\n                                <a class=\"job-method\" href=\"");


            
            #line 100 "..\..\Pages\FailedJobsPage.cshtml"
                                                       Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    ");


            
            #line 101 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </a>\r\n                            </div>\r\n");


            
            #line 104 "..\..\Pages\FailedJobsPage.cshtml"
                             if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <div style=\"color: #888;\">\r\n                     " +
"               ");


            
            #line 107 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.Reason);

            
            #line default
            #line hidden
WriteLiteral(" <a class=\"expander\" href=\"#\">More&nbsp;details...</a>\r\n                         " +
"       </div>\r\n");


            
            #line 109 "..\..\Pages\FailedJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\r\n                    </tr>\r\n");


            
            #line 112 "..\..\Pages\FailedJobsPage.cshtml"
                    if (job.Value.InFailedState)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <tr>\r\n                            <td colspan=\"2\" class=\"" +
"failed-job-details\">\r\n                                <div class=\"expandable\" st" +
"yle=\"");


            
            #line 116 "..\..\Pages\FailedJobsPage.cshtml"
                                                           Write(index++ == 0 ? "display: block;" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                    <h4>");


            
            #line 117 "..\..\Pages\FailedJobsPage.cshtml"
                                   Write(job.Value.ExceptionType);

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                                    <p>\r\n                                 " +
"       ");


            
            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
                                   Write(job.Value.ExceptionMessage);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                    </p>\r\n\r\n");


            
            #line 122 "..\..\Pages\FailedJobsPage.cshtml"
                                     if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                                    {

            
            #line default
            #line hidden
WriteLiteral("                                        <pre class=\"stack-trace\">");


            
            #line 124 "..\..\Pages\FailedJobsPage.cshtml"
                                                            Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails));

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n");


            
            #line 125 "..\..\Pages\FailedJobsPage.cshtml"
                                    }

            
            #line default
            #line hidden
WriteLiteral("                                </div>\r\n                            </td>\r\n      " +
"                  </tr>\r\n");


            
            #line 129 "..\..\Pages\FailedJobsPage.cshtml"
                    }
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\r\n        </table>\r\n    </div>\r\n");


            
            #line 134 "..\..\Pages\FailedJobsPage.cshtml"

    
            
            #line default
            #line hidden
            
            #line 135 "..\..\Pages\FailedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 135 "..\..\Pages\FailedJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #18
0
        /// <summary>
        /// 回复分页
        /// </summary>
        public Pager GetReplyPaging(Pager pager, int parentid)
        {
            IQueryable<blog_article> query = GetArticlesViaStatus();

            if (parentid > 0)
                query = query.Where(m => m.parentid == parentid);

            pager.Amount = query.Count();
            query = query.OrderBy(m => m.id).Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #19
0
        /// <summary>
        /// 标签下文章分页
        /// </summary>
        public Pager GetTagArticlePaging(Pager pager, int tid, string tag)
        {
            IQueryable<blog_varticle> query = GetArticles(tid, 0, 0).Where(m =>
                                      ("," + m.tags + ",").Contains("," + tag + ","));

            pager.Amount = query.Count();
            query = query.OrderByDescending(m => m.id).Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #20
0
        /// <summary>
        /// 回复分页(layer不限)
        /// </summary>
        public Pager GetReplyPaging(Pager pager, int tid, string cids, int layer, string sort = "", string order = "desc", string user = "")
        {
            IQueryable<blog_article> query = entity.blog_article;
            if (tid > 0)
                query = query.Where(m => m.typeid == tid);
            if (cids != "")
            {
                List<int> listids = new List<string>(cids.Split(',')).ConvertAll(i => int.Parse(i));
                query = query.Where(m => listids.Contains(m.cateid));
            }
            if (user != "")
                query = query.Where(m => m.userid == 1).Where(m => m.username == user);

            query = query.Where(m => m.layer == layer);
            switch (sort)
            {
                case "normal":
                    query = query.Where(m => m.status == 1);
                    break;
                case "status":
                    query = query.Where(m => m.status == 2);
                    break;
                case "istop":
                    query = query.Where(m => m.istop == 1);
                    break;
                case "iscomment":
                    query = query.Where(m => m.iscommend == 1);
                    break;
            }
            pager.Amount = query.Count();

            if (order == "desc")
                query = query.OrderByDescending(m => m.id);
            else
                query = query.OrderBy(m => m.id);

            query = query.Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #21
0
        /// <summary>
        /// 回复分页(layer不限)
        /// </summary>
        public Pager GetReplyPaging(Pager pager, int tid,int cid,int layer, string sort = "", string order = "desc",string user="")
        {
            IQueryable<blog_article> query = entity.blog_article;
            query = query.Where(m => m.layer == layer);
            if (cid > 0)
                query = query.Where(m => m.cateid == cid);

            if (tid > 0)
                query = query.Where(m => m.typeid == tid);

            if (user!="")
                query = query.Where(m => m.userid == 1).Where(m => m.username == user);

            switch (sort)
            {
                case "normal":
                    query = query.Where(m => m.status == 1);
                    break;
                case "status":
                    query = query.Where(m => m.status == 2);
                    break;
                case "istop":
                    query = query.Where(m => m.istop == 1);
                    break;
                case "iscommend":
                    query = query.Where(m => m.iscommend == 1);
                    break;
            }
            pager.Amount = query.Count();

            if (order == "desc")
                query = query.OrderByDescending(m => m.id);
            else
                query = query.OrderBy(m => m.id);

            query = query.Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #22
0
        /// <summary>
        /// 回复分页(layer=1)
        /// </summary>
        public Pager GetReplyPaging(Pager pager, int tid, int cid, string sort = "", string order = "desc", string user = "")
        {
            IQueryable<blog_varticle> query = GetReplyArticles(tid, cid, 0,user);

            switch (sort)
            {
                case "normal":
                    query = query.Where(m => m.status == 1);
                    break;
                case "status":
                    query = query.Where(m => m.status == 2);
                    break;
                case "istop":
                    query = query.Where(m => m.istop == 1);
                    break;
                case "iscommend":
                    query = query.Where(m => m.iscommend == 1);
                    break;
            }
            pager.Amount = query.Count();

            if (order == "desc")
                query = query.OrderByDescending(m => m.id);
            else
                query = query.OrderBy(m => m.id);

            query = query.Skip(pager.PageSize * pager.PageNo).Take(pager.PageSize);
            pager.Entity = query;
            return pager;
        }
コード例 #23
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Scheduled Jobs" };

    int from, perPage;

    int.TryParse(Request.Query["from"], out from);
    int.TryParse(Request.Query["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.ScheduledCount())
    {
        BasePageUrl = Request.LinkTo("/scheduled")
    };

    JobList<ScheduledJobDto> scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 24 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        There are no scheduled jobs.\r\n    </d" +
"iv>\r\n");


            
            #line 29 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\r\n        <div class=\"btn-toolbar btn-toolbar-top\">" +
"\r\n            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\r\n     " +
"               data-url=\"");


            
            #line 35 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                         Write(Request.LinkTo("/scheduled/enqueue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-play""></span>
                Enqueue now
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 42 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                         Write(Request.LinkTo("/scheduled/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 49 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th>Enqueue</th>
                    <th>Job</th>
                    <th class=""align-right"">Scheduled</th>
                </tr>
            </thead>
");


            
            #line 64 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
             foreach (var job in scheduledJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"js-jobs-list-row ");


            
            #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                        Write(!job.Value.InScheduledState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 66 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                                                                                Write(job.Value.InScheduledState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n");


            
            #line 68 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                         if (job.Value.InScheduledState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <input type=\"checkbox\" class=\"js-jobs-list-checkbox\" " +
"name=\"jobs[]\" value=\"");


            
            #line 70 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                                                                                 Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\r\n");


            
            #line 71 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
"              <a href=\"");


            
            #line 74 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 75 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 77 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                         if (!job.Value.InScheduledState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 80 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"min-width\">\r\n          " +
"              <span data-moment=\"");


            
            #line 83 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                      Write(JobHelper.ToTimestamp(job.Value.EnqueueAt));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 84 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                       Write(job.Value.EnqueueAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n                        <a class=\"job-method\" href=\"");


            
            #line 88 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                               Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 89 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n                    </td>\r\n                    <t" +
"d class=\"align-right\">\r\n");


            
            #line 93 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                         if (job.Value.ScheduledAt != null)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 95 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                          Write(JobHelper.ToTimestamp(job.Value.ScheduledAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 96 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                           Write(job.Value.ScheduledAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 98 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 101 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </table>\r\n    </div>\r\n");


            
            #line 104 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"

    
            
            #line default
            #line hidden
            
            #line 105 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 105 "..\..\Dashboard\Pages\ScheduledJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #24
0
        public override void Execute()
        {


WriteLiteral("\r\n");








            
            #line 8 "..\..\Pages\FailedJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Failed Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<FailedJobDto> failedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.FailedCount())
        {
            BasePageUrl = Request.LinkTo("/failed")
        };

        failedJobs = monitor
            .FailedJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 31 "..\..\Pages\FailedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-success\">\r\n        You have no failed jobs at the mom" +
"ent.\r\n    </div>\r\n");


            
            #line 36 "..\..\Pages\FailedJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 39 "..\..\Pages\FailedJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 39 "..\..\Pages\FailedJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table failed-table\">\r\n        <thead>\r\n            <tr>\r\n      " +
"          <th>Id</th>\r\n                <th>Failed</th>\r\n                <th>Job<" +
"/th>\r\n                <th></th>\r\n            </tr>\r\n        </thead>\r\n        <t" +
"body>\r\n");


            
            #line 51 "..\..\Pages\FailedJobsPage.cshtml"
               var index = 0; 

            
            #line default
            #line hidden

            
            #line 52 "..\..\Pages\FailedJobsPage.cshtml"
             foreach (var job in failedJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 54 "..\..\Pages\FailedJobsPage.cshtml"
                       Write(!job.Value.InFailedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td rowspan=\"");


            
            #line 55 "..\..\Pages\FailedJobsPage.cshtml"
                             Write(job.Value.InFailedState ? "2" : "1");

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <a href=\"");


            
            #line 56 "..\..\Pages\FailedJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 57 "..\..\Pages\FailedJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 59 "..\..\Pages\FailedJobsPage.cshtml"
                         if (!job.Value.InFailedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 62 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 65 "..\..\Pages\FailedJobsPage.cshtml"
                         if (job.Value.FailedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 67 "..\..\Pages\FailedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.FailedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 68 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(job.Value.FailedAt);

            
            #line default
            #line hidden
WriteLiteral("        \r\n                            </span>\r\n");


            
            #line 70 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td class=\"");


            
            #line 72 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(job.Value.InFailedState ? "expander" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        <div>\r\n                            <span title=\"");


            
            #line 74 "..\..\Pages\FailedJobsPage.cshtml"
                                    Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 75 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n                        </div>\r\n");


            
            #line 78 "..\..\Pages\FailedJobsPage.cshtml"
                         if (!String.IsNullOrEmpty(job.Value.ExceptionMessage))
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <div style=\"color: #888;\">\r\n                         " +
"       ");


            
            #line 81 "..\..\Pages\FailedJobsPage.cshtml"
                           Write(job.Value.Reason);

            
            #line default
            #line hidden
WriteLiteral(" <span class=\"caret\"></span>\r\n                            </div>\r\n");


            
            #line 83 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n");


            
            #line 86 "..\..\Pages\FailedJobsPage.cshtml"
                         if (job.Value.InFailedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <div class=\"pull-right\">\r\n                           " +
"     <button class=\"btn btn-primary btn-sm\" data-ajax=\"");


            
            #line 89 "..\..\Pages\FailedJobsPage.cshtml"
                                                                             Write(Request.LinkTo("/failed/retry/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Retrying...\">\r\n                                    <span cla" +
"ss=\"glyphicon glyphicon-repeat\"></span>\r\n                                    Ret" +
"ry\r\n                                </button>\r\n                            </div" +
">\r\n");


            
            #line 94 "..\..\Pages\FailedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 97 "..\..\Pages\FailedJobsPage.cshtml"
                if (job.Value.InFailedState)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr>\r\n                        <td colspan=\"4\" class=\"failed-j" +
"ob-details\">\r\n                            <div class=\"expandable\" style=\"");


            
            #line 101 "..\..\Pages\FailedJobsPage.cshtml"
                                                       Write(index++ == 0 ? "display: block;" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                <h4>");


            
            #line 102 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.ExceptionType);

            
            #line default
            #line hidden
WriteLiteral("</h4>\r\n                                <p>\r\n                                    ");


            
            #line 104 "..\..\Pages\FailedJobsPage.cshtml"
                               Write(job.Value.ExceptionMessage);

            
            #line default
            #line hidden
WriteLiteral("\r\n                                </p>\r\n                        \r\n");


            
            #line 107 "..\..\Pages\FailedJobsPage.cshtml"
                                 if (!String.IsNullOrEmpty(job.Value.ExceptionDetails))
                                {

            
            #line default
            #line hidden
WriteLiteral("                                    <pre class=\"stack-trace\">");


            
            #line 109 "..\..\Pages\FailedJobsPage.cshtml"
                                                        Write(HtmlHelper.MarkupStackTrace(job.Value.ExceptionDetails));

            
            #line default
            #line hidden
WriteLiteral("</pre>\r\n");


            
            #line 110 "..\..\Pages\FailedJobsPage.cshtml"
                                }

            
            #line default
            #line hidden
WriteLiteral("                            </div>\r\n                        </td>\r\n              " +
"      </tr>\r\n");


            
            #line 114 "..\..\Pages\FailedJobsPage.cshtml"
                }
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 118 "..\..\Pages\FailedJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 119 "..\..\Pages\FailedJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
コード例 #25
0
        public override void Execute()
        {


WriteLiteral("\n");







            
            #line 7 "..\..\Pages\ProcessingJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Processing Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    var monitor = JobStorage.Current.GetMonitoringApi();
    Pager pager = new Pager(from, perPage, monitor.ProcessingCount())
    {
        BasePageUrl = Request.LinkTo("/processing")
    };

    JobList<ProcessingJobDto> processingJobs = monitor
        .ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);


            
            #line default
            #line hidden
WriteLiteral("\n");


            
            #line 25 "..\..\Pages\ProcessingJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\n        No jobs are being processed right now." +
"\n    </div>\n");


            
            #line 30 "..\..\Pages\ProcessingJobsPage.cshtml"
}
else
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"js-jobs-list\">\n        <div class=\"btn-toolbar btn-toolbar-top\">\n" +
"            <button class=\"js-jobs-list-command btn btn-sm btn-primary\"\n        " +
"            data-url=\"");


            
            #line 36 "..\..\Pages\ProcessingJobsPage.cshtml"
                         Write(Request.LinkTo("/processing/requeue"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Enqueueing..."">
                <span class=""glyphicon glyphicon-repeat""></span>
                Requeue jobs
            </button>

            <button class=""js-jobs-list-command btn btn-sm btn-default""
                    data-url=""");


            
            #line 43 "..\..\Pages\ProcessingJobsPage.cshtml"
                         Write(Request.LinkTo("/processing/delete"));

            
            #line default
            #line hidden
WriteLiteral(@"""
                    data-loading-text=""Deleting...""
                    data-confirm=""Do you really want to DELETE ALL selected jobs?"">
                <span class=""glyphicon glyphicon-remove""></span>
                Delete selected
            </button>

            ");


            
            #line 50 "..\..\Pages\ProcessingJobsPage.cshtml"
       Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
WriteLiteral(@"
        </div>

        <table class=""table"">
            <thead>
                <tr>
                    <th class=""min-width"">
                        <input type=""checkbox"" class=""js-jobs-list-select-all"" />
                    </th>
                    <th class=""min-width"">Id</th>
                    <th class=""min-width"">Server</th>
                    <th>Job</th>
                    <th class=""align-right"">Started</th>
                </tr>
            </thead>
            <tbody>
");


            
            #line 66 "..\..\Pages\ProcessingJobsPage.cshtml"
                 foreach (var job in processingJobs)
                {

            
            #line default
            #line hidden
WriteLiteral("                    <tr class=\"js-jobs-list-row ");


            
            #line 68 "..\..\Pages\ProcessingJobsPage.cshtml"
                                            Write(!job.Value.InProcessingState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral(" ");


            
            #line 68 "..\..\Pages\ProcessingJobsPage.cshtml"
                                                                                                     Write(job.Value.InProcessingState ? "hover" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\n                        <td>\n");


            
            #line 70 "..\..\Pages\ProcessingJobsPage.cshtml"
                             if (job.Value.InProcessingState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <input type=\"checkbox\" class=\"js-jobs-list-checkb" +
"ox\" name=\"jobs[]\" value=\"");


            
            #line 72 "..\..\Pages\ProcessingJobsPage.cshtml"
                                                                                                     Write(job.Key);

            
            #line default
            #line hidden
WriteLiteral("\" />\n");


            
            #line 73 "..\..\Pages\ProcessingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        <a href=\"");


            
            #line 76 "..\..\Pages\ProcessingJobsPage.cshtml"
                                Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 77 "..\..\Pages\ProcessingJobsPage.cshtml"
                           Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n");


            
            #line 79 "..\..\Pages\ProcessingJobsPage.cshtml"
                             if (!job.Value.InProcessingState)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span title=\"Job\'s state has been changed while f" +
"etching data.\" class=\"glyphicon glyphicon-question-sign\"></span>\n");


            
            #line 82 "..\..\Pages\ProcessingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                        <td class=\"min-width\">\n    " +
"                        ");


            
            #line 85 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(job.Value.ServerId.ToUpperInvariant());

            
            #line default
            #line hidden
WriteLiteral("\n                        </td>\n                        <td>\n                     " +
"       <a class=\"job-method\" href=\"");


            
            #line 88 "..\..\Pages\ProcessingJobsPage.cshtml"
                                                   Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                ");


            
            #line 89 "..\..\Pages\ProcessingJobsPage.cshtml"
                           Write(HtmlHelper.DisplayMethod(job.Value.Job));

            
            #line default
            #line hidden
WriteLiteral("\n                            </a>\n                        </td>\n                 " +
"       <td class=\"align-right\">\n");


            
            #line 93 "..\..\Pages\ProcessingJobsPage.cshtml"
                             if (job.Value.StartedAt.HasValue)
                            {

            
            #line default
            #line hidden
WriteLiteral("                                <span data-moment=\"");


            
            #line 95 "..\..\Pages\ProcessingJobsPage.cshtml"
                                              Write(JobHelper.ToTimestamp(job.Value.StartedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\n                                    ");


            
            #line 96 "..\..\Pages\ProcessingJobsPage.cshtml"
                               Write(job.Value.StartedAt);

            
            #line default
            #line hidden
WriteLiteral("\n                                </span>\n");


            
            #line 98 "..\..\Pages\ProcessingJobsPage.cshtml"
                            }

            
            #line default
            #line hidden
WriteLiteral("                        </td>\n                    </tr>\n");


            
            #line 101 "..\..\Pages\ProcessingJobsPage.cshtml"
                }

            
            #line default
            #line hidden
WriteLiteral("            </tbody>\n        </table>\n    </div>\n");


            
            #line 105 "..\..\Pages\ProcessingJobsPage.cshtml"
    
            
            #line default
            #line hidden
            
            #line 105 "..\..\Pages\ProcessingJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 105 "..\..\Pages\ProcessingJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #26
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Pages\ProcessingJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Processing Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<ProcessingJobDto> processingJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.ProcessingCount())
        {
            BasePageUrl = Request.LinkTo("/processing")
        };

        processingJobs = monitor
            .ProcessingJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 30 "..\..\Pages\ProcessingJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        No jobs are being processed right now" +
".\r\n    </div>\r\n");


            
            #line 35 "..\..\Pages\ProcessingJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 38 "..\..\Pages\ProcessingJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 38 "..\..\Pages\ProcessingJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Job</th>\r\n                <th>Server</th>\r\n       " +
"         <th>Started</th>\r\n            </tr>\r\n        </thead>\r\n        <tbody>\r" +
"\n");


            
            #line 50 "..\..\Pages\ProcessingJobsPage.cshtml"
             foreach (var job in processingJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 52 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(!job.Value.InProcessingState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n                        <a href=\"");


            
            #line 54 "..\..\Pages\ProcessingJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 55 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </a>\r\n");


            
            #line 57 "..\..\Pages\ProcessingJobsPage.cshtml"
                         if (!job.Value.InProcessingState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 60 "..\..\Pages\ProcessingJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                    <td>\r\n                        <spa" +
"n title=\"");


            
            #line 63 "..\..\Pages\ProcessingJobsPage.cshtml"
                                Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 64 "..\..\Pages\ProcessingJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n                        ");


            
            #line 68 "..\..\Pages\ProcessingJobsPage.cshtml"
                   Write(job.Value.ServerName);

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </td>\r\n                    <td>\r\n");


            
            #line 71 "..\..\Pages\ProcessingJobsPage.cshtml"
                         if (job.Value.StartedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 73 "..\..\Pages\ProcessingJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.StartedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 74 "..\..\Pages\ProcessingJobsPage.cshtml"
                           Write(job.Value.StartedAt);

            
            #line default
            #line hidden
WriteLiteral("\r\n                            </span>\r\n");


            
            #line 76 "..\..\Pages\ProcessingJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 79 "..\..\Pages\ProcessingJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 82 "..\..\Pages\ProcessingJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 83 "..\..\Pages\ProcessingJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 83 "..\..\Pages\ProcessingJobsPage.cshtml"
                                        
}

            
            #line default
            #line hidden

        }
コード例 #27
0
        public override void Execute()
        {


WriteLiteral("\r\n");







            
            #line 7 "..\..\Pages\ScheduledJobsPage.cshtml"
  
    Layout = new LayoutPage { Title = "Scheduled Jobs" };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<ScheduleDto> scheduledJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.ScheduledCount())
        {
            BasePageUrl = Request.LinkTo("/scheduled")
        };

        scheduledJobs = monitor.ScheduledJobs(pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 29 "..\..\Pages\ScheduledJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        There are no scheduled jobs.\r\n    </d" +
"iv>\r\n");


            
            #line 34 "..\..\Pages\ScheduledJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 37 "..\..\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 37 "..\..\Pages\ScheduledJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Enqueue</th>\r\n                <th>Job</th>\r\n      " +
"          <th></th>\r\n            </tr>\r\n        </thead>\r\n");


            
            #line 48 "..\..\Pages\ScheduledJobsPage.cshtml"
         foreach (var job in scheduledJobs)
        {

            
            #line default
            #line hidden
WriteLiteral("            <tr class=\"");


            
            #line 50 "..\..\Pages\ScheduledJobsPage.cshtml"
                   Write(!job.Value.InScheduledState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                <td>\r\n                    <a href=\"");


            
            #line 52 "..\..\Pages\ScheduledJobsPage.cshtml"
                        Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        ");


            
            #line 53 "..\..\Pages\ScheduledJobsPage.cshtml"
                   Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </a>\r\n");


            
            #line 55 "..\..\Pages\ScheduledJobsPage.cshtml"
                     if (!job.Value.InScheduledState)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <span title=\"Job\'s state has been changed while fetching " +
"data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 58 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </td>\r\n                <td data-moment=\"");


            
            #line 60 "..\..\Pages\ScheduledJobsPage.cshtml"
                            Write(JobHelper.ToStringTimestamp(job.Value.EnqueueAt));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 60 "..\..\Pages\ScheduledJobsPage.cshtml"
                                                                                 Write(job.Value.EnqueueAt);

            
            #line default
            #line hidden
WriteLiteral("</td>\r\n                <td>\r\n                    <span title=\"");


            
            #line 62 "..\..\Pages\ScheduledJobsPage.cshtml"
                            Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                        ");


            
            #line 63 "..\..\Pages\ScheduledJobsPage.cshtml"
                   Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                    </span>\r\n                </td>\r\n                <td>\r\n");


            
            #line 67 "..\..\Pages\ScheduledJobsPage.cshtml"
                     if (job.Value.InScheduledState)
                    {

            
            #line default
            #line hidden
WriteLiteral("                        <button class=\"btn btn-default btn-sm\" data-ajax=\"");


            
            #line 69 "..\..\Pages\ScheduledJobsPage.cshtml"
                                                                     Write(Request.LinkTo("/schedule/enqueue/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\" data-loading-text=\"Enqueueing...\">\r\n                            <span class=\"gl" +
"yphicon glyphicon-play\"></span>\r\n                            Enqueue now\r\n      " +
"                  </button>\r\n");


            
            #line 73 "..\..\Pages\ScheduledJobsPage.cshtml"
                    }

            
            #line default
            #line hidden
WriteLiteral("                </td>\r\n            </tr>\r\n");


            
            #line 76 "..\..\Pages\ScheduledJobsPage.cshtml"
        }

            
            #line default
            #line hidden
WriteLiteral("    </table>\r\n");


            
            #line 78 "..\..\Pages\ScheduledJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 79 "..\..\Pages\ScheduledJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 79 "..\..\Pages\ScheduledJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
コード例 #28
0
        public override void Execute()
        {


WriteLiteral("\r\n");










            
            #line 10 "..\..\Pages\EnqueuedJobsPage.cshtml"
  
    Layout = new LayoutPage
        {
            Title = Queue.ToUpperInvariant(), 
            Subtitle = "Enqueued jobs",
            Breadcrumbs = new Dictionary<string, string>
                {
                    { "Queues", Request.LinkTo("/queues") }
                }
        };

    int from, perPage;

    int.TryParse(Request.QueryString["from"], out from);
    int.TryParse(Request.QueryString["count"], out perPage);

    Pager pager;
    JobList<EnqueuedJobDto> enqueuedJobs;

    using (var monitor = JobStorage.Current.GetMonitoringApi())
    {
        pager = new Pager(from, perPage, monitor.EnqueuedCount(Queue))
        {
            BasePageUrl = Request.LinkTo("/queues/" + Queue)
        };

        enqueuedJobs = monitor
            .EnqueuedJobs(Queue, pager.FromRecord, pager.RecordsPerPage);
    }


            
            #line default
            #line hidden
WriteLiteral("\r\n");


            
            #line 41 "..\..\Pages\EnqueuedJobsPage.cshtml"
 if (pager.TotalPageCount == 0)
{

            
            #line default
            #line hidden
WriteLiteral("    <div class=\"alert alert-info\">\r\n        The queue is empty.\r\n    </div>\r\n");


            
            #line 46 "..\..\Pages\EnqueuedJobsPage.cshtml"
}
else
{
    
            
            #line default
            #line hidden
            
            #line 49 "..\..\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new PerPageSelector(pager)));

            
            #line default
            #line hidden
            
            #line 49 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                              
    

            
            #line default
            #line hidden
WriteLiteral("    <table class=\"table\">\r\n        <thead>\r\n            <tr>\r\n                <th" +
">Id</th>\r\n                <th>Job</th>\r\n                <th>Enqueued</th>\r\n     " +
"       </tr>\r\n        </thead>\r\n        <tbody>\r\n");


            
            #line 60 "..\..\Pages\EnqueuedJobsPage.cshtml"
             foreach (var job in enqueuedJobs)
            {

            
            #line default
            #line hidden
WriteLiteral("                <tr class=\"");


            
            #line 62 "..\..\Pages\EnqueuedJobsPage.cshtml"
                       Write(!job.Value.InEnqueuedState ? "obsolete-data" : null);

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                    <td>\r\n                        <a href=\"");


            
            #line 64 "..\..\Pages\EnqueuedJobsPage.cshtml"
                            Write(Request.LinkTo("/job/" + job.Key));

            
            #line default
            #line hidden
WriteLiteral("\">");


            
            #line 64 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                                                Write(HtmlHelper.JobId(job.Key));

            
            #line default
            #line hidden
WriteLiteral("</a>\r\n");


            
            #line 65 "..\..\Pages\EnqueuedJobsPage.cshtml"
                         if (!job.Value.InEnqueuedState)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span title=\"Job\'s state has been changed while fetch" +
"ing data.\" class=\"glyphicon glyphicon-question-sign\"></span>\r\n");


            
            #line 68 "..\..\Pages\EnqueuedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td> \r\n                    <td>\r\n                        <sp" +
"an title=\"");


            
            #line 71 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                Write(HtmlHelper.DisplayMethodHint(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                            ");


            
            #line 72 "..\..\Pages\EnqueuedJobsPage.cshtml"
                       Write(HtmlHelper.DisplayMethod(job.Value.MethodData));

            
            #line default
            #line hidden
WriteLiteral("\r\n                        </span>\r\n                    </td>\r\n                   " +
" <td>\r\n");


            
            #line 76 "..\..\Pages\EnqueuedJobsPage.cshtml"
                         if (job.Value.EnqueuedAt.HasValue)
                        {

            
            #line default
            #line hidden
WriteLiteral("                            <span data-moment=\"");


            
            #line 78 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                          Write(JobHelper.ToStringTimestamp(job.Value.EnqueuedAt.Value));

            
            #line default
            #line hidden
WriteLiteral("\">\r\n                                ");


            
            #line 79 "..\..\Pages\EnqueuedJobsPage.cshtml"
                           Write(job.Value.EnqueuedAt);

            
            #line default
            #line hidden
WriteLiteral("        \r\n                            </span>\r\n");


            
            #line 81 "..\..\Pages\EnqueuedJobsPage.cshtml"
                        }

            
            #line default
            #line hidden
WriteLiteral("                    </td>\r\n                </tr>\r\n");


            
            #line 84 "..\..\Pages\EnqueuedJobsPage.cshtml"
            }

            
            #line default
            #line hidden
WriteLiteral("        </tbody>\r\n    </table>\r\n");


            
            #line 87 "..\..\Pages\EnqueuedJobsPage.cshtml"
    
    
            
            #line default
            #line hidden
            
            #line 88 "..\..\Pages\EnqueuedJobsPage.cshtml"
Write(RenderPartial(new Paginator(pager)));

            
            #line default
            #line hidden
            
            #line 88 "..\..\Pages\EnqueuedJobsPage.cshtml"
                                        
}
            
            #line default
            #line hidden

        }
コード例 #29
0
ファイル: EditorDal.cs プロジェクト: jorzen2010/HealthCrm
        public static Pager GetEditorPage(Pager pager, string strwhere, string table)
        {
            SqlParameter[] arParms = new SqlParameter[9];
            //@tbname   --要分页显示的表名
            arParms[0] = new SqlParameter("@tbname", SqlDbType.NVarChar, 30);
            arParms[0].Value = table;

            // @FieldKey --用于定位记录的主键(惟一键)字段,可以是逗号分隔的多个字段
            arParms[1] = new SqlParameter("@FieldKey", SqlDbType.NVarChar, 40);
            arParms[1].Value = "EditorId";

            //@PageCurrent --要显示的页码
            arParms[2] = new SqlParameter("@PageCurrent", SqlDbType.Int);
            arParms[2].Value = pager.PageNo + 1;

            // @PageSize --每页的大小(记录数)
            arParms[3] = new SqlParameter("@PageSize", SqlDbType.Int);
            arParms[3].Value = pager.PageSize;

            //@FieldShow  --以逗号分隔的要显示的字段列表,如果不指定,则显示所有字段
            arParms[4] = new SqlParameter("@FieldShow", SqlDbType.NVarChar, 500);
            arParms[4].Value = "*";

            //@FieldOrder --以逗号分隔的排序字段列表,可以指定在字段后面指定DESC/ASC用于指定排序顺序

            arParms[5] = new SqlParameter("@FieldOrder", SqlDbType.NVarChar, 500);
            arParms[5].Value = "EditorId desc";

            //@Where   --查询条件
            arParms[6] = new SqlParameter("@Where", SqlDbType.VarChar, 8000);
            arParms[6].Value = strwhere;

            //@PageCount --总页数
            arParms[7] = new SqlParameter("@PageCount", SqlDbType.Int);
            arParms[7].Direction = ParameterDirection.Output;

            //@RecordCount --总记录数
            arParms[8] = new SqlParameter("@RecordCount", SqlDbType.Int);
            arParms[8].Direction = ParameterDirection.Output;
            SqlConnection myconn = new SqlConnection(CommonDal.ConnectionString);
            try
            {
            EditorDto editorDto = null;
            List<EditorDto> list = new List<EditorDto>();
            DataTable dt = null;
            DataSet ds = SqlHelper.ExecuteDataset(myconn, CommandType.StoredProcedure, "sp_AspNetPageView", arParms);
            dt = ds.Tables[0];
            foreach (DataRow dr in dt.Rows)
            {
                editorDto = EditorDal.getDataRowToEditorDto(dr);
                list.Add(editorDto);
            }

            var totalItems = (int)arParms[8].Value;

            pager.Amount = totalItems;
            pager.Entity = list.AsQueryable();
            pager.PageCount = (int)arParms[7].Value;

            return pager;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {

                myconn.Close();
                myconn.Dispose();
            }
        }
コード例 #30
0
 public static Pager GetDoctorPager(Pager pager,string strwhere,string table)
 {
     //return DoctorDal.GetDoctorPage(pager, strwhere,table);
     return DoctorDal.GetDoctorPage(pager, strwhere, table);
 }