示例#1
0
        public JsonResult Contact(ContactModel Contact)
        {
            var jsonResult = new Dictionary <string, int>();

            jsonResult["code"] = 401;

            if (ModelState.IsValid)
            {
                var result = StaticCode.SendContact(Contact);

                if (result)
                {
                    jsonResult["code"] = 100;
                }
                else
                {
                    jsonResult["code"] = 500;
                }
            }
            else
            {
                jsonResult["code"] = 404;
            }

            return(Json(jsonResult));
        }
示例#2
0
        public async Task Execute(IJobExecutionContext context)
        {
            try
            {
                var dataMap = context.JobDetail.JobDataMap;
                var action  = (ScheduleBase.ScheduleAction)Enum.Parse(typeof(ScheduleBase.ScheduleAction), dataMap["action"].ToString());
                StaticCode.OnScheduleArrived(action);
            }
            catch (Exception ex)
            {
                StaticCode.Logger?.Here().Error(ex.Message);
            }

            await Task.CompletedTask;
        }
示例#3
0
        public async Task Execute(IJobExecutionContext context)
        {
            try
            {
                var update = GetUpdate();

                if ((update != null) && (update.LatestVersion > Assembly.GetExecutingAssembly().GetName().Version))
                {
                    StaticCode.UpdateUrl = update.DownloadUrl;
                    StaticCode.OnUpdateAvailablityChanged(true);
                }
            }
            catch (Exception ex)
            {
                StaticCode.Logger?.Here().Error(ex.Message);
            }

            await Task.CompletedTask;
        }
示例#4
0
 public async Task Execute(IJobExecutionContext context)
 {
     StaticCode.OnUpdateAvailablityChanged(false);
     await Task.CompletedTask;
 }