Esempio n. 1
0
        public JsonResult LoadTask(string idcampaign, string idpath, string idstatus)
        {
            try
            {
                Timer timer          = new Timer(3000);
                Guid  idCampaignGuid = Guid.Parse(idcampaign);
                Guid  idAccount      = ApplicationUserCurrent.AccountId;
                var   data           = _taskCampaignBusiness.taskMigrate(idpath, idAccount, idCampaignGuid, idstatus);
                timer.Start();
                var rows = from x in data
                           select new
                {
                    description = x.description,
                    data        = x.Element,
                    Code        = x.Code
                };

                var jsondata = rows.ToArray();
                return(Json(jsondata));
            }
            catch (Exception e)
            {
                _logger.LogError(new EventId(0, "Error Index"), e.Message);
                IList <TaskMigrateResultViewModel> data = new List <TaskMigrateResultViewModel>();
                data.Add(new TaskMigrateResultViewModel {
                    description = e.Message, Element = "0", Code = "0"
                });
                var rows = from x in data
                           select new
                {
                    description = x.description,
                    data        = x.Element,
                    Code        = x.Code
                };

                var jsondata = rows.ToArray();
                return(Json(jsondata));
            }
        }