Пример #1
0
        void IJob.Execute(IJobExecutionContext context)
        {
            var               artApi = new ApiMethod();
            var               ar     = new ArticleRep();
            List <string>     art    = new List <string>();
            List <ArticleApi> artDes = new List <ArticleApi>();
            int               i      = 0;

            artApi.Api(art, artDes);
            if (artDes.Count != 0)
            {
                foreach (var item in artDes)
                {
                    ar.Insert(ar.GetByIdApi(item.Id).ProccessResult);
                    i++;
                    if (i == 20)
                    {
                        break;
                    }
                }
            }
        }
 public ActionResult Add(int id)
 {
     result = ar.Insert(ar.GetByIdApi(id).ProccessResult);
     return(Json(result.UserMessage));
 }