Exemple #1
0
 public IndexModel(trackinger.Models.TrackingerContext context)
 {
     _context = context;
 }
Exemple #2
0
        public static void Initialize(TrackingerContext context)
        {
            if (context.User.Any() && context.Bug.Any() && context.Notification.Any())
            {
                return; // database has already been initialized
            }

            context.User.AddRange(
                new User
            {
                Login   = "******",
                Name    = "Abraham",
                Surname = "Lincoln"
            },
                new User
            {
                Login   = "******",
                Name    = "William",
                Surname = "Shakespear"
            },
                new User
            {
                Login   = "******",
                Name    = "Johnny",
                Surname = "Deep"
            },
                new User
            {
                Login   = "******",
                Name    = "Ada",
                Surname = "Lovelace"
            }
                );
            context.SaveChanges();

            context.Bug.AddRange(
                new Bug
            {
                Title       = "Shopping cart display",
                Description =
                    "When opening a shopping cart display, webpage crushes and there is a 500 http error displayed.",
                Priority     = Priority.medium,
                CreationDate = new DateTime(2019, 5, 12, 12, 30, 52),
                CreatorId    = 1
            },
                new Bug
            {
                Title       = "Logging with invalid credentials",
                Description =
                    "When user enters wrong password, he is authorized anyway.",
                Priority     = Priority.high,
                CreationDate = new DateTime(2019, 4, 1, 13, 30, 52),
                CreatorId    = 2
            }
                );
            context.SaveChanges();

            context.Notification.AddRange(
                new Notification
            {
                Description =
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rutrum, purus eu aliquam blandit, lectus dolor tincidunt urna, vitae",
                BugId            = 1,
                AssigneeId       = 1,
                Status           = Status.open,
                NotificationDate = new DateTime(2019, 5, 12, 12, 30, 52)
            },
                new Notification
            {
                Description =
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rutrum, purus eu aliquam blandit, lectus dolor tincidunt urna, vitae",
                BugId            = 2,
                AssigneeId       = 2,
                Status           = Status.open,
                NotificationDate = new DateTime(2019, 4, 1, 13, 30, 52)
            },
                new Notification
            {
                Description =
                    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed rutrum, purus eu aliquam blandit, lectus dolor tincidunt urna, vitae",
                BugId            = 2,
                AssigneeId       = 3,
                Status           = Status.in_progress,
                NotificationDate = new DateTime(2019, 4, 3, 13, 30, 52)
            }
                );
            context.SaveChanges();
        }
Exemple #3
0
 public CreateModel(trackinger.Models.TrackingerContext context)
 {
     _context = context;
 }
Exemple #4
0
 public DetailsModel(trackinger.Models.TrackingerContext context)
 {
     _context = context;
 }
Exemple #5
0
 public EditModel(trackinger.Models.TrackingerContext context)
 {
     _context = context;
 }