コード例 #1
0
        public ActionResult UpdateVideoQueStatus(int id, VideoQueueStatus status)
        {
            VideoQueue vq = db.VideoQueues.Find(id);

            if (vq != null)
            {
                vq.VideoStatus     = status;
                db.Entry(vq).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }
            else
            {
                return(Json(new { Error = "Error no video Q found" }));
            }
            return(Json(new { Success = true }));
        }
コード例 #2
0
        public bool UpdateVideoQueStatus(int id, VideoQueueStatus status)
        {
            var client = new RestClient(APIPath);

            client.AddDefaultHeader("api-key", ApiKey);
            var request = new RestRequest("updatevideoquestatus", Method.POST);

            request.AddParameter("id", id);
            request.AddParameter("status", status);

            var response = client.Execute(request);

            if (response != null && response.Content != null)
            {
                if (response.Content == "{\"Success\":true}")
                {
                    return(true);
                }
                string errorDescription = "Error setting video que status from API! Status Code: " + response.StatusCode.ToString();
                RenderErrors.ReportError(VideoManager.Code.ErrorSeverity.Warning, errorDescription, "DataAccess", "UpdateVideoQueStatus", "228", id);
            }
            return(false);
        }