public HomeController(ILogger <HomeController> logger, SubmissionContext context, PayPeriodContext pcontext, UserManager <AdminUIUser> userManager)
 {
     _logger      = logger;
     _context     = context;
     _pcontext    = pcontext;
     _userManager = userManager;
 }
Ejemplo n.º 2
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            var db = new SubmissionContext();

//            return View(db.Submissions.OrderBy(s => s.SessionTitle).OrderBy(s => s.ConferenceName));
            return(View(db.Submissions.Take(200)));
        }
        // GET: /<controller>/
        public IActionResult Index()
        {
            var db = new SubmissionContext();

            return(View(db.Submissions));
//            return View(db.Submissions.Take(3));
        }
 public DataLockSteps(DataLockContext dataLockContext, CommitmentsContext commitmentsContext, SubmissionContext submissionContext, EmployerAccountContext employerAccountContext, LookupContext lookupContext)
 {
     DataLockContext        = dataLockContext;
     CommitmentsContext     = commitmentsContext;
     SubmissionContext      = submissionContext;
     EmployerAccountContext = employerAccountContext;
     LookupContext          = lookupContext;
 }
Ejemplo n.º 5
0
 public EmployerAccountSteps(EmployerAccountContext employerAccountContext,
                             EarningsAndPaymentsContext earningsAndPaymentsContext,
                             SubmissionContext submissionContext)
 {
     EmployerAccountContext     = employerAccountContext;
     EarningsAndPaymentsContext = earningsAndPaymentsContext;
     SubmissionContext          = submissionContext;
 }
Ejemplo n.º 6
0
 public static void AddALot()
 {
     using (var db = new SubmissionContext())
     {
         // Put a loop here and add a ton of records to see the performance
         // db.SaveChanges();
     }
 }
Ejemplo n.º 7
0
        public IActionResult DeleteConfirmed(int id)
        {
            var        _context   = new SubmissionContext();
            Submission submission = _context.Submissions.Single(m => m.ID == id);

            _context.Submissions.Remove(submission);
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 8
0
        public SubmissionContext GetSubmissionContext()
        {
            var options = new DbContextOptionsBuilder <SubmissionContext>()
                          .UseInMemoryDatabase(databaseName: "InMemoryArticleDatabase")
                          .Options;
            var dbContext = new SubmissionContext(options);

            return(dbContext);
        }
Ejemplo n.º 9
0
 public IActionResult Edit(Submission submission)
 {
     if (ModelState.IsValid)
     {
         var _context = new SubmissionContext();
         _context.Update(submission);
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(submission));
 }
Ejemplo n.º 10
0
        public IActionResult Create(Submission submission)
        {
            if (ModelState.IsValid)
            {
                var _context = new SubmissionContext();
                _context.Submissions.Add(submission);
                _context.SaveChanges();

                PerformanceExample.AddALot();
                return(RedirectToAction("Index"));
            }
            return(View(submission));
        }
        public static void ParseLearningSupportIntoContext(SubmissionContext submissionContext, Table learningSupportStatus)
        {
            if (learningSupportStatus.Rows.Count < 1)
            {
                throw new ArgumentOutOfRangeException("Learning support table must have at least 1 row");
            }

            var structure = ParseContractTypesTableStructure(learningSupportStatus);

            foreach (var row in learningSupportStatus.Rows)
            {
                submissionContext.LearningSupportStatus.Add(ParseLearningSupportTableRow(row, structure));
            }
        }
Ejemplo n.º 12
0
        public static void ParseContractTypesIntoContext(SubmissionContext submissionContext, Table contractTypes)
        {
            if (contractTypes.Rows.Count < 1)
            {
                throw new ArgumentOutOfRangeException("Contract types table must have at least 1 row");
            }

            var structure = ParseContractTypesTableStructure(contractTypes);

            foreach (var row in contractTypes.Rows)
            {
                submissionContext.ContractTypes.Add(ParseContractTypeTableRow(row, structure));
            }
        }
        public static void ParseIlrTableIntoContext(SubmissionContext context, Table ilrDetails)
        {
            if (ilrDetails.RowCount < 1)
            {
                throw new ArgumentException("ILR table must have at least 1 row");
            }

            var structure = ParseTableStructure(ilrDetails);

            foreach (var row in ilrDetails.Rows)
            {
                context.IlrLearnerDetails.Add(ParseCommitmentsTableRow(row, structure));
            }
        }
Ejemplo n.º 14
0
 public EarningAndPaymentSteps(EmployerAccountContext employerAccountContext,
                               EarningsAndPaymentsContext earningsAndPaymentsContext,
                               DataLockContext dataLockContext,
                               SubmissionContext submissionContext,
                               LookupContext lookupContext,
                               CommitmentsContext commitmentsContext)
 {
     EmployerAccountContext     = employerAccountContext;
     EarningsAndPaymentsContext = earningsAndPaymentsContext;
     DataLockContext            = dataLockContext;
     SubmissionContext          = submissionContext;
     LookupContext      = lookupContext;
     CommitmentsContext = commitmentsContext;
 }
        public static void ParseEmploymentStatusIntoContext(SubmissionContext submissionContext, Table employmentStatus)
        {
            if (employmentStatus.Rows.Count < 1)
            {
                throw new ArgumentOutOfRangeException("Employment status table must have at least 1 row");
            }

            var structure = ParseEmploymentStatusTableStructure(employmentStatus);

            foreach (var row in employmentStatus.Rows)
            {
                submissionContext.EmploymentStatus.Add(ParseEmploymentStatusTableRow(row, structure));
            }
        }
Ejemplo n.º 16
0
        // GET: Submissions/Edit/5
        public IActionResult Edit(int?id)
        {
            if (id == null)
            {
                //return HttpNotFound();
            }

            var        _context   = new SubmissionContext();
            Submission submission = _context.Submissions.Single(m => m.ID == id);

            if (submission == null)
            {
                //return HttpNotFound();
            }
            return(View(submission));
        }
Ejemplo n.º 17
0
        public static void Main(string[] args)
        {
            // Make sure the Database exists
            using (var db = new SubmissionContext())
            {
                db.Database.EnsureCreated();
            };

            // Build the self-hosting
            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseIISIntegration()
                       .UseStartup <Startup>().UseUrls("http://*:5000")
                       .Build();

            // LAUNCH!
            host.Run();
        }
 public SubmissionControllerTests()
 {
     _scontext = new InMemoryDbContextFactory().GetSubmissionContext();
     _logger   = new NullLogger <SubmissionController>();
     _scontext.Add(new Timesheet {
         ClientName      = "client",
         ClientPrime     = "prime",
         ProviderName    = "provider",
         ProviderId      = "id",
         TotalHours      = 34.3,
         ServiceGoal     = "To help her eat cheese",
         ProgressNotes   = "She ate the cheese",
         FormType        = "OR526 Attendant Care",
         Submitted       = DateTime.Parse("4/2/20 2:03PM"),
         RejectionReason = "",
         Status          = "Pending",
         UriString       = "hi,hello,how are you",
         LockInfo        = new Lock
         {
             User         = "******",
             LastActivity = DateTime.Now
         }
     }
                   );
     _scontext.Add(new Timesheet {
         ClientName      = "client",
         ClientPrime     = "prime",
         ProviderName    = "provider",
         ProviderId      = "id",
         TotalHours      = 34.3,
         ServiceGoal     = "To help her eat cheese",
         ProgressNotes   = "She ate the cheese",
         FormType        = "OR526 Attendant Care",
         Submitted       = DateTime.Parse("4/2/20 2:03PM"),
         RejectionReason = "",
         Status          = "Pending",
         UriString       = "hi,hello,how are you"
     }
                   );
     _scontext.SaveChanges();
 }
Ejemplo n.º 19
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new SubmissionContext(
                       serviceProvider.GetRequiredService <DbContextOptions <SubmissionContext> >()))
            {
                if (context.Submissions.Any())
                {
                    return;
                }
                context.Submissions.AddRange(
                    new Submission
                {
                    FirstName    = "Anne",
                    LastName     = "Bjørnsen",
                    Email        = "*****@*****.**",
                    SerialNumber = 11111111
                },
                    new Submission
                {
                    FirstName    = "Charlie",
                    LastName     = "Davidsen",
                    Email        = "*****@*****.**",
                    SerialNumber = 41451234
                },
                    new Submission
                {
                    FirstName    = "Emma",
                    LastName     = "Fralsen",
                    Email        = "*****@*****.**",
                    SerialNumber = 31452948
                }

                    );
                context.SaveChanges();
            }
        }
 public SubmissionSteps(CommitmentsContext commitmentsContext, SubmissionContext submissionsContext, LookupContext lookupContext)
 {
     CommitmentsContext = commitmentsContext;
     SubmissionsContext = submissionsContext;
     LookupContext      = lookupContext;
 }
Ejemplo n.º 21
0
 private static void ValidateLearnerSpecificEarningsAndPayments(EarningsAndPaymentsContext earningsAndPaymentsContext, SubmissionContext submissionContext, EmployerAccountContext employerAccountContext)
 {
     foreach (var breakdown in earningsAndPaymentsContext.LearnerOverallEarningsAndPayments)
     {
         var learnerResults = submissionContext.SubmissionResults.Where(r => r.LearnerId == breakdown.LearnerId).ToArray();
         try
         {
             foreach (var rule in Rules)
             {
                 rule.AssertBreakdown(breakdown, learnerResults, employerAccountContext);
             }
         }
         catch (Exception ex)
         {
             throw new Exception($"{ex.Message} (learner {breakdown.LearnerId})", ex);
         }
     }
 }
Ejemplo n.º 22
0
 private static void ValidateOverallEarningsAndPayments(EarningsAndPaymentsContext earningsAndPaymentsContext, SubmissionContext submissionContext, EmployerAccountContext employerAccountContext)
 {
     foreach (var breakdown in earningsAndPaymentsContext.OverallEarningsAndPayments)
     {
         foreach (var rule in Rules)
         {
             rule.AssertBreakdown(breakdown, submissionContext.SubmissionResults, employerAccountContext);
         }
     }
 }
Ejemplo n.º 23
0
        public static void AssertPaymentsAndEarningsResults(EarningsAndPaymentsContext earningsAndPaymentsContext, SubmissionContext submissionContext, EmployerAccountContext employerAccountContext)
        {
            if (TestEnvironment.ValidateSpecsOnly)
            {
                return;
            }

            ValidateOverallEarningsAndPayments(earningsAndPaymentsContext, submissionContext, employerAccountContext);
            ValidateLearnerSpecificEarningsAndPayments(earningsAndPaymentsContext, submissionContext, employerAccountContext);
        }
        public static void AssertPaymentsAndEarningsResults(SubmissionDataLockContext dataLockContext, SubmissionContext submissionContext)
        {
            if (TestEnvironment.ValidateSpecsOnly)
            {
                return;
            }

            var submissionResults = submissionContext.SubmissionResults.ToArray();

            new OnProgrammeDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForOnProgramme, submissionResults);
            new CompletionDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForCompletion, submissionResults);
            new BalancingDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForBalancing, submissionResults);
            new DisadvantageUpliftDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForDisadvantageUplift, submissionResults);
            new Employer16To18IncentiveDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForEmployer16To18Incentive, submissionResults);
            new Provider16To18IncentiveDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForProvider16To18Incentive, submissionResults);
            new EnglishAndMathsOnProgrammeDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForEnglishAndMathOnProgramme, submissionResults);
            new EnglishAndMathsBalancingDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForEnglishAndMathBalancing, submissionResults);
            new FrameworkUpliftOnProgrammeDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForFrameworkUpliftOnProgramme, submissionResults);
            new FrameworkUpliftCompletionDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForFrameworkUpliftCompletion, submissionResults);
            new FrameworkUpliftBalancingDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForFrameworkUpliftBalancing, submissionResults);
            new LearningSupportDataLockRule().AssertPaymentTypeDataLockMatches(dataLockContext.DataLockStatusForLearningSupport, submissionResults);
        }
Ejemplo n.º 25
0
        public static void InitializeSubmissionDb(SubmissionContext context)
        {
            if (context.Submissions.Any())
            {
                return;   // DB has been seeded
            }

            context.Submissions.AddRange(
                new Timesheet
            {
                ClientName      = "Minnie Mouse",
                ClientPrime     = "M0U5E",
                Edited          = true,
                ProviderName    = "Mickey Mouse",
                ProviderId      = "B1GM0U53",
                TotalHours      = 10,
                FormType        = "OR526 Attendant Care",
                ServiceGoal     = "To help her eat cheese",
                ProgressNotes   = "She ate the cheese",
                Submitted       = DateTime.Parse("4/2/20 2:03PM"),
                RejectionReason = "",
                Status          = "Pending",
                UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                  "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                TimeEntries = new List <TimeEntry>
                {
                    new TimeEntry {
                        Date   = DateTime.Parse("3/27/20"),
                        In     = DateTime.Parse("12:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 4,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/28/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/29/20"),
                        In     = DateTime.Parse("2:00pm"),
                        Out    = DateTime.Parse("6:30pm"),
                        Hours  = 4.5,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/30/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("4/1/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    }
                }
            },
                new Timesheet
            {
                ClientName      = "Beast",
                ClientPrime     = "666",
                Edited          = false,
                ProviderName    = "Belle",
                ProviderId      = "B3113",
                TotalHours      = 80.7,
                FormType        = "OR526 Attendant Care",
                ServiceGoal     = "Transmogrification",
                ProgressNotes   = "Progress is a little hairy",
                Submitted       = DateTime.Parse("4/2/20 1:45PM"),
                RejectionReason = "",
                Status          = "Pending",
                UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                  "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                TimeEntries = new List <TimeEntry>
                {
                    new TimeEntry {
                        Date   = DateTime.Parse("3/27/20"),
                        In     = DateTime.Parse("12:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 4,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/28/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/29/20"),
                        In     = DateTime.Parse("2:00pm"),
                        Out    = DateTime.Parse("6:30pm"),
                        Hours  = 4.5,
                        Group  = true,
                        Status = "Pending"
                    }
                }
            },
                new Timesheet
            {
                ClientName      = "Cinderella",
                ClientPrime     = "5L1PP3R",
                Edited          = true,
                ProviderName    = "Prince Charming",
                ProviderId      = "H0TT13",
                TotalHours      = 54.5,
                FormType        = "OR526 Attendant Care",
                ServiceGoal     = "Shoe sizing",
                ProgressNotes   = "If the shoe fits, I must commit",
                Submitted       = DateTime.Parse("4/3/20 8:06AM"),
                RejectionReason = "",
                Status          = "Pending",
                UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                  "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                TimeEntries = new List <TimeEntry>
                {
                    new TimeEntry {
                        Date   = DateTime.Parse("3/27/20"),
                        In     = DateTime.Parse("12:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 4,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/29/20"),
                        In     = DateTime.Parse("2:00pm"),
                        Out    = DateTime.Parse("6:30pm"),
                        Hours  = 4.5,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/30/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("4/1/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    }
                }
            },
                new Timesheet
            {
                ClientName      = "Anna",
                ClientPrime     = "R3DH3AD",
                Edited          = false,
                ProviderName    = "Elsa",
                ProviderId      = "L3T1TG0",
                TotalHours      = 12,
                FormType        = "OR526 Attendant Care",
                ServiceGoal     = "To help with her transition to queen",
                ProgressNotes   = "She aight",
                Submitted       = DateTime.Parse("4/4/20 5:13PM"),
                RejectionReason = "",
                Status          = "Pending",
                UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                  "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                TimeEntries = new List <TimeEntry>
                {
                    new TimeEntry {
                        Date   = DateTime.Parse("3/28/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/29/20"),
                        In     = DateTime.Parse("2:00pm"),
                        Out    = DateTime.Parse("6:30pm"),
                        Hours  = 4.5,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("3/30/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("4/1/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    }
                }
            },
                new Timesheet
            {
                ClientName      = "Snow White",
                ClientPrime     = "5L33PY",
                Edited          = false,
                ProviderName    = "Prince Florian",
                ProviderId      = "K155",
                TotalHours      = 89.2,
                FormType        = "OR526 Attendant Care",
                ServiceGoal     = "To wake her up",
                ProgressNotes   = "She needs an energy drink or something",
                Submitted       = DateTime.Parse("4/2/20 10:20AM"),
                RejectionReason = "",
                Status          = "Pending",
                UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                  "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                TimeEntries = new List <TimeEntry>
                {
                    new TimeEntry {
                        Date   = DateTime.Parse("3/27/20"),
                        In     = DateTime.Parse("12:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 4,
                        Group  = true,
                        Status = "Pending"
                    },
                    new TimeEntry {
                        Date   = DateTime.Parse("4/1/20"),
                        In     = DateTime.Parse("3:00pm"),
                        Out    = DateTime.Parse("4:00pm"),
                        Hours  = 1,
                        Group  = true,
                        Status = "Pending"
                    }
                }
            });

            for (var i = 1; i <= 101; i++)
            {
                context.Submissions.Add(
                    new Timesheet
                {
                    ClientName      = "Dalmation " + i,
                    ClientPrime     = "5P0T5",
                    Edited          = false,
                    ProviderName    = "Dalmation Dad",
                    ProviderId      = "T1R3D",
                    TotalHours      = 80.0,
                    ServiceGoal     = "To make sure the kids survive",
                    ProgressNotes   = "Still alive",
                    FormType        = "OR526 Attendant Care",
                    Submitted       = DateTime.Parse("4/1/20 10:20AM"),
                    RejectionReason = "",
                    Status          = "Pending",
                    UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                      "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                    TimeEntries = new List <TimeEntry>
                    {
                        new TimeEntry
                        {
                            Date   = DateTime.Parse("3/27/20"),
                            In     = DateTime.Parse("12:00pm"),
                            Out    = DateTime.Parse("4:00pm"),
                            Hours  = 4,
                            Group  = true,
                            Status = "Pending"
                        },
                        new TimeEntry
                        {
                            Date   = DateTime.Parse("3/28/20"),
                            In     = DateTime.Parse("3:00pm"),
                            Out    = DateTime.Parse("4:00pm"),
                            Hours  = 1,
                            Group  = true,
                            Status = "Pending"
                        },
                        new TimeEntry
                        {
                            Date   = DateTime.Parse("3/29/20"),
                            In     = DateTime.Parse("2:00pm"),
                            Out    = DateTime.Parse("6:30pm"),
                            Hours  = 4.5,
                            Group  = true,
                            Status = "Pending"
                        },
                        new TimeEntry
                        {
                            Date   = DateTime.Parse("3/30/20"),
                            In     = DateTime.Parse("3:00pm"),
                            Out    = DateTime.Parse("4:00pm"),
                            Hours  = 1,
                            Group  = true,
                            Status = "Pending"
                        },
                        new TimeEntry
                        {
                            Date   = DateTime.Parse("4/1/20"),
                            In     = DateTime.Parse("3:00pm"),
                            Out    = DateTime.Parse("4:00pm"),
                            Hours  = 1,
                            Group  = true,
                            Status = "Pending"
                        }
                    }
                }

                    );
                var rand = new Random();
                context.Submissions.Add(
                    new MileageForm
                {
                    ClientName      = "Hun Soldier " + i,
                    ClientPrime     = "M0NG0L",
                    Edited          = false,
                    ProviderName    = "Atila The Hun",
                    ProviderId      = "011700",
                    TotalMiles      = 200 - i,
                    ServiceGoal     = "To find Mulan",
                    ProgressNotes   = "Rumor has it that he may actually be a woman in disguise",
                    FormType        = "OR004 Mileage",
                    Submitted       = DateTime.Parse("5/" + rand.Next(1, 30) + "/20 " + rand.Next(1, 12) + ":00AM"),
                    RejectionReason = "",
                    Status          = "Pending",
                    UriString       = "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5642367_OR507_526_front.png," +
                                      "https://iddstorageaccountdev.blob.core.windows.net/submissionfiles/2020-05-14-07-19-41-5431700_OR507_526_back.png",
                    MileageEntries = new List <MileageEntry>
                    {
                        new MileageEntry
                        {
                            Date          = DateTime.Parse("3/27/20"),
                            Miles         = 4,
                            Group         = true,
                            PurposeOfTrip = "Run to the grocery store",
                            Status        = "Pending"
                        },
                        new MileageEntry
                        {
                            Date          = DateTime.Parse("3/28/20"),
                            Miles         = 10,
                            Group         = true,
                            PurposeOfTrip = "Dropping kids off at school",
                            Status        = "Pending"
                        },
                        new MileageEntry
                        {
                            Date          = DateTime.Parse("3/29/20"),
                            Miles         = 5,
                            Group         = true,
                            PurposeOfTrip = "Run to the pharmacy",
                            Status        = "Pending"
                        },
                        new MileageEntry
                        {
                            Date          = DateTime.Parse("3/30/20"),
                            Miles         = 50,
                            Group         = true,
                            PurposeOfTrip = "Roadtrip!",
                            Status        = "Pending"
                        },
                        new MileageEntry
                        {
                            Date          = DateTime.Parse("4/1/20"),
                            Miles         = 25,
                            Group         = true,
                            PurposeOfTrip = "I'm just putting a really long string in here just to see what happens when the various modules try to display it",
                            Status        = "Pending"
                        },
                    }
                }

                    );
            }

            context.SaveChanges();
        }
 public FormToDbUtil(SubmissionContext context, SubmissionStagingContext sscontext)
 {
     _scontext  = context;
     _sscontext = sscontext;
 }
Ejemplo n.º 27
0
 public SubmissionController(ILogger <SubmissionController> logger, SubmissionContext context)
 {
     _logger  = logger;
     _context = context;
 }
Ejemplo n.º 28
0
 public ImageUploadController(SubmissionStagingContext context, SubmissionContext scontext)
 {
     _context  = context;
     _scontext = scontext;
 }
Ejemplo n.º 29
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, RoleManager <IdentityRole> roleManager, PayPeriodContext ppcontext, SubmissionContext scontext)
        {
            GlobalVariables.CurrentPayPeriod = ppcontext.PayPeriods.FirstOrDefault(p => p.Current);
            SeedRoles(roleManager);

            if (env.IsDevelopment())
            {
                MockData.InitializeSubmissionDb(scontext);
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                // Homescreen route
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });
        }
 /*******************************************************************************
 *  /// Constructor
 *******************************************************************************/
 public TimesheetController(SubmissionStagingContext context, SubmissionContext subcontext)
 {
     _context    = context;
     _subcontext = subcontext;
 }