public ActionResult Index()
        {
            if (!_context.SystemControls.Any())
            {
                _context.SystemControls.Add(new SystemControl()
                {
                    Status = 0
                });
                _context.SaveChanges();
            }

            ViewBag.Status = _context.SystemControls.First().Status;
            return(View());
        }
Exemplo n.º 2
0
 public void Save(GoCanvasDbContext dbContext)
 {
     try
     {
         try
         {
             dbContext.Database.ExecuteSqlRaw($"INSERT INTO [tblMySubmissions]([FormName],[GoCanSubmissionGUID])VALUES ('{this.Form.Name}', '{this.Submission.SubmissionGuid.ToString()}');");
         }
         catch (Exception exception)
         {
             Console.WriteLine(exception);
         }
     }
     catch (Exception e)
     {
         dbContext.MySubmissions.Load();
         dbContext.MySubmissions.Add(new MySubmissions()
         {
             FormName = this.Form.Name, GoCanSubmissionGUID = this.Submission.SubmissionGuid.ToString()
         });
         dbContext.SaveChanges();
     }
 }