コード例 #1
0
 public EditAssignmentDeadlineModel(AssignmentDbContext phd, ProfileDbContext pDb)
 {
     assignmentDbContext = phd;
     newAssignment       = new Assignment();
     profileDbContext    = pDb;
     CurrentProfile      = new Profile();
 }
コード例 #2
0
 public ViewAssignmentAdminModel(AssignmentDbContext phd, ProfileDbContext pDbContext)
 {
     assignmentDbContext = phd;
     newAssignment       = new Assignment();
     profileDbContext    = pDbContext;
     CurrentProfile      = new Profile();
 }
コード例 #3
0
 public SubmissionSuccessfulModel(AssignmentDbContext adb, CourseDbContext cdb, IOptions <Assignment> globalAssignment)
 {
     assignmentDbContext = adb;
     courseDbContext     = cdb;
     CurrentCourse       = new Course();
     GlobalAssignment    = globalAssignment.Value;
 }
コード例 #4
0
ファイル: TaskService.cs プロジェクト: skyder2008/Assignment
        //TODO:Remove the constructor after using Ioc and Data referance
        public TaskService()
        {
            AssignmentDbContext context = new AssignmentDbContext();

            _taskRepository     = new EfRepository <Task>(context);
            _userTaskRepository = new EfRepository <UserTask>(context);
        }
コード例 #5
0
 public DeleteAssignmentModel(AssignmentDbContext phd, ProfileDbContext pDb)
 {
     assignmentDbContext = phd;
     profileDbContext    = pDb;
     CurrentProfile      = new Profile();
     newAssignment       = new Assignment();
 }
コード例 #6
0
        public static void MockCustomer(AssignmentDbContext assignmentDbContext)
        {
            var customer1 = new Customer()
            {
                Name       = "Customer1",
                Email      = "*****@*****.**",
                Phone      = 71234568,
                CreateDate = DateTime.Now,
                UpdateDate = DateTime.Now
            };

            var customer2 = new Customer()
            {
                Name       = "Customer2",
                Email      = "*****@*****.**",
                Phone      = 234567189,
                CreateDate = DateTime.Now,
                UpdateDate = DateTime.Now
            };

            var customer3 = new Customer()
            {
                Name       = "Customer3",
                Email      = "*****@*****.**",
                Phone      = 1239874,
                CreateDate = DateTime.Now,
                UpdateDate = DateTime.Now
            };

            assignmentDbContext.Add(customer1);
            assignmentDbContext.Add(customer2);
            assignmentDbContext.Add(customer3);
            assignmentDbContext.SaveChanges();
        }
コード例 #7
0
 public EditAssignmentsPageModel(AssignmentDbContext asd, ProfileDbContext pDb)
 {
     assignmentDbContext    = asd;
     OldAssignmentsList     = new List <Assignment>();
     OngoingAssignmentsList = new List <Assignment>();
     profileDbContext       = pDb;
     CurrentProfile         = new Profile();
 }
コード例 #8
0
ファイル: UserService.cs プロジェクト: skyder2008/Assignment
        //TODO:Remove the constructor after using Ioc and Data referance
        public UserService()
        {
            AssignmentDbContext context = new AssignmentDbContext();

            _userRepository      = new EfRepository <User>(context);
            _groupRepository     = new EfRepository <Group>(context);
            _userGroupRepository = new EfRepository <UserGroup>(context);;
        }
コード例 #9
0
 public AssignmentsModel(AssignmentDbContext adb, CourseDbContext cdb)
 {
     assignmentDbContext = adb;
     courseDbContext     = cdb;
     PendingAssignments  = new List <Assignment>();
     OldAssignments      = new List <Assignment>();
     CurrentCourse       = new Course();
 }
コード例 #10
0
 public ViewAssignmentModel(AssignmentDbContext adb, CourseDbContext cdb)
 {
     assignmentDbContext = adb;
     courseDbContext     = cdb;
     CurrentAssignment   = new Assignment();
     CurrentCourse       = new Course();
     IfDue = false;
 }
コード例 #11
0
 public UploadAssignmentAttachmentPageModel(AssignmentDbContext adb, ProfileDbContext pDbContext)
 {
     assignmentDbContext = adb;
     CurrentAssignment   = new Assignment();
     CurrentAssignment   = adb.Assignments.Last();
     profileDbContext    = pDbContext;
     CurrentProfile      = new Profile();
 }
コード例 #12
0
 public SubmitAssignmentModel(SubmissionDbContext sdb, AssignmentDbContext adb, CourseDbContext cdb, IOptions <Assignment> globalAssignment)
 {
     submissionDbContext = sdb;
     assignmentDbContext = adb;
     courseDbContext     = cdb;
     CurrentCourse       = new Course();
     CurrentAssignment   = new Assignment();
     GlobalAssignment    = globalAssignment.Value;
 }
コード例 #13
0
 public CourseModel(CourseDbContext cdb, AssignmentDbContext adb, ProfileDbContext pdb)
 {
     courseDbContext     = cdb;
     assignmentDbContext = adb;
     profileDbContext    = pdb;
     CurrentCourse       = new Course();
     CurrentProfile      = new Profile();
     AssignmentList      = new List <Assignment>();
     TAs = new List <string>();
 }
コード例 #14
0
        public AddNewAssignmentModel(AssignmentDbContext adb, CourseDbContext cdb, ProfileDbContext pdb)
        {
            assignmentDbContext = adb;
            courseDbContext     = cdb;

            CoursesList   = new List <Course>();
            newAssignment = new Assignment();

            profileDbContext = pdb;
            CurrentProfile   = new Profile();
        }
コード例 #15
0
ファイル: SeedHelper.cs プロジェクト: mrameezraja/Assigment
        public static void SeedHostDb(AssignmentDbContext context)
        {
            context.SuppressAutoSetTenantId = true;

            // Host seed
            new InitialHostDbBuilder(context).Create();

            // Default tenant seed (in host database).
            new DefaultTenantBuilder(context).Create();
            new TenantRoleAndUserBuilder(context, 1).Create();
        }
コード例 #16
0
        /// <summary>
        /// IntervalData method returns jsonstring.
        /// </summary>
        public string IntervalData()
        {
            // Create an DB Context Object
            AssignmentDbContext dbContext = new AssignmentDbContext();

            /* The below Linq code groups the data on TimSlot Hour
             * and selects the required column data to generate the response object*/

            var intervalData = dbContext.IntervalData
                               .AsEnumerable()
                               .GroupBy(row => row.TimeSlot.Hours)
                               .Select(grp => new
            {
                TimeSlot      = grp.Key,
                SlotValue     = grp.Select(u => u.SlotVal).Sum() / 2,
                DeliveryPoint = grp.Select(u => u.DeliveryPoint).FirstOrDefault(),
                Date          = grp.Select(u => u.Date).FirstOrDefault(),
                Id            = grp.Select(u => u.Id).FirstOrDefault()
            });

            return(JsonConvert.SerializeObject(intervalData.ToArray()));
        }
コード例 #17
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                try
                {
                    var assignmentDbContext = new AssignmentDbContext(GetOptions(Configuration.GetConnectionString("DefaultConnection")));
                    if (!assignmentDbContext.Database.CanConnect())
                    {
                        assignmentDbContext.Database.Migrate();
                        assignmentDbContext.SeedingsData();
                    }
                }
                catch (SqlException)
                {
                }
            }
            else
            {
                // 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.UseMvc();

            // Enable middleware to serve generated Swagger as a JSON endpoint.
            app.UseSwagger();

            // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
            // specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "API V1");
            });
        }
コード例 #18
0
 public ProductController()
 {
     dbContext = new AssignmentDbContext();
 }
コード例 #19
0
 public AuthenticationUsersController(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #20
0
 public CourseAssignmentsController(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #21
0
 public AgentController(AssignmentDbContext context, IHostingEnvironment hostingEnvironment, IMapper mapper)
 {
     _context            = context;
     _hostingEnvironment = hostingEnvironment;
     _mapper             = mapper;
 }
コード例 #22
0
 public DefaultCowsSensorsCreator(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #23
0
 public DefaultEditionCreator(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #24
0
 public ClassesController(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #25
0
 public HostRoleAndUserCreator(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #26
0
 public DefaultSettingsCreator(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #27
0
 public MarkupPlanController(AssignmentDbContext context)
 {
     _context = context;
 }
コード例 #28
0
 public UploadAssignmentModel(SubmissionDbContext sdb, AssignmentDbContext asb, IOptions <Assignment> globalAssignment)
 {
     submissionDbContext = sdb;
     assignmentDbContext = asb;
     GlobalAssignment    = globalAssignment.Value;
 }
コード例 #29
0
 public TenantRoleAndUserBuilder(AssignmentDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
コード例 #30
0
 public UploadAssignmentAttachmentModel(AssignmentDbContext adb)
 {
     assignmentDbContext = adb;
 }