/// <summary>
 /// Initializes a new instance of the <see cref="LabinatorService" /> class.
 /// </summary>
 /// This version is used when Unit Testing.
 /// <param name="db">Handle to the dummy Database</param>
 public LabinatorService(ILabinatorDb db)
 {
     this.ServiceName = "Labinator_Service";
     this.CanStop = true;
     this.CanPauseAndContinue = true;
     this.AutoLog = true;
     this.db = db;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LabinatorService"/> class.
 /// </summary>
 /// This version is used when running.
 public LabinatorService()
 {
     this.ServiceName = "Labinator_Service";
     this.CanStop = true;
     this.CanPauseAndContinue = true;
     this.AutoLog = true;
     this.db = new LabinatorContext();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvcApplication"/> class.
 /// This version used in production and creates a handle for the Database
 /// </summary>
 public MvcApplication()
 {
     this.db = new LabinatorContext();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClassroomsController"/> class.
 /// Used for constructing when Unit Testing.
 /// </summary>
 /// <param name="db">Handle to Database interface stub.</param>
 /// <param name="st">Handle to Sky Tap interface stub.</param>
 public ClassroomsController(ILabinatorDb db, ISkyTap st)
 {
     this.db = db;
     this.st = st;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClassroomsController"/> class.
 /// Used for regular constructions. Obtains handle to Database.
 /// </summary>
 public ClassroomsController()
 {
     this.db = new LabinatorContext();
     this.st = new SkyTap();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataCentersController"/> class for use in testing.
 /// </summary>
 /// <param name="db">The Fake database</param>
 public DataCentersController(ILabinatorDb db)
 {
     this.db = db;
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UsersController"/> class.
 /// Used for regular constructions. Obtains handle to Database.
 /// </summary>
 public UsersController()
 {
     this.db   = new LabinatorContext();
     this.auth = new FormsAuthWrapper();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportsController"/> class for use in testing.
 /// </summary>
 /// <param name="db">The Fake database</param>
 /// <param name="st">The Fake sky tap</param>
 public ReportsController(ILabinatorDb db, ISkyTap st)
 {
     this.db = db;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// Used for constructing when Unit Testing.
 /// </summary>
 /// <param name="db">Handle to Database stub.</param>
 public HomeController(ILabinatorDb db)
 {
     this.db = db;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// Used for regular constructions. Obtains handle to Database.
 /// </summary>
 public HomeController()
 {
     this.db = new LabinatorContext();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UsersController"/> class.
 /// Used for constructing when Unit Testing.
 /// </summary>
 /// <param name="db">Handle to Database stub.</param>
 /// <param name="auth">Handle to the Authenticator stub.</param>
 public UsersController(ILabinatorDb db, IAuth auth)
 {
     this.db = db;
     this.auth = auth;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UsersController"/> class.
 /// Used for regular constructions. Obtains handle to Database.
 /// </summary>
 public UsersController()
 {
     this.db = new LabinatorContext();
     this.auth = new FormsAuthWrapper();
 }
Beispiel #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// This version is used when unit testing and takes in the handles.
 /// </summary>
 /// <param name="db">Stub for the fake Database.</param>
 public HomeController(ILabinatorDb db)
 {
     this.db = db;
 }
Beispiel #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HomeController"/> class.
 /// This version used in production and creates handles for both the Database and the SkyTap interface
 /// </summary>
 public HomeController()
 {
     this.db = new LabinatorContext();
 }
Beispiel #15
0
 /// <summary>
 /// Writes a log message to the database. This version is used to log system-generated messages.
 /// </summary>
 /// <param name="db">The database handle.</param>
 /// <param name="logEntry">The log entry to write.</param>
 public static void Write(ILabinatorDb db, Log logEntry)
 {
     logEntry.User = "******";
     logEntry.TimeStamp = DateTime.Now;
     db.Add<Log>(logEntry);
     db.SaveChanges();
 }
Beispiel #16
0
        /// <summary>
        /// Writes a log message to the database. This version is used to log web-generated messages.
        /// </summary>
        /// <param name="db">The database handle.</param>
        /// <param name="cx">The context of the User.</param>
        /// <param name="logEntry">The log entry to write.</param>
        public static void Write(ILabinatorDb db, HttpContextBase cx, Log logEntry)
        {
            if ((logEntry.User == null) || (logEntry.User == string.Empty))
            {
                logEntry.User = cx.User.Identity.Name;
            }

            logEntry.TimeStamp = DateTime.Now;
            db.Add<Log>(logEntry);
            db.SaveChanges();
        }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MvcApplication"/> class.
 /// This version used in production and creates a handle for the Database
 /// </summary>
 public MvcApplication()
 {
     this.db = new LabinatorContext();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportsController"/> class for use live.
 /// </summary>
 public ReportsController()
 {
     this.db = new LabinatorContext();
 }
Beispiel #19
0
 public UserManager(ILabinatorDb liLabinatorDb)
 {
     _liLabinatorDb = liLabinatorDb;
 }
Beispiel #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UsersController"/> class.
 /// Used for constructing when Unit Testing.
 /// </summary>
 /// <param name="db">Handle to Database stub..</param>
 public UsersController(ILabinatorDb db)
 {
     this.db = db;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CoursesController"/> class for use in testing.
 /// </summary>
 /// <param name="db">The Fake database</param>
 /// <param name="st">The Fake SkyTap</param>
 public CoursesController(ILabinatorDb db, ISkyTap st)
 {
     this.db = db;
     this.st = st;
     this.template = new Template(this.st);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CoursesController"/> class for use live.
 /// </summary>
 public CoursesController()
 {
     this.db = new LabinatorContext();
     this.st = new SkyTap();
     this.template = new Template(this.st);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DataCentersController"/> class for use live.
 /// </summary>
 public DataCentersController()
 {
     this.db = new LabinatorContext();
 }