public void AddJobTest()
        {
            MobileContent mobileContent = new MobileContent()
            {
                TenantId = 100002,
                UserId   = 112664957,
                ToUserId = 112664957,
                Content  = "hello",
                OId      = "6cd57b3b-dab9-44f8-be16-9ae974b8e523",
                RunTime  = new DateTime(2019, 1, 17, 20, 0, 0)
            };

            JobArgs args = new JobArgs()
            {
                TenantId   = mobileContent.TenantId,
                OperatorId = mobileContent.UserId,
                JobKey     = mobileContent.OId,
                Job        = new TestJob()
                {
                    Args = mobileContent.ToJson()
                },
                RunTime      = mobileContent.RunTime,
                LimitSeconds = 10,
                JobAppName   = "UPaaSDemo"
            };

            JobProvider.AddJob(args);
            Assert.Fail();
        }
Example #2
0
        public ActionResult Create(CreateEditViewModel model)
        {
            var job = new Job();

            Mapper.DynamicMap(model, job);
            jobProvider.AddJob(job);

            var jsonViewModel = new AjaxViewModel(true, null, null);

            return(Json(jsonViewModel));
        }