public ControlConsole(ContentManager Content) { this.Texture = Content.Load<Texture2D>("Main"); this.overlay = Content.Load<Texture2D>("SlotBG"); name = "Mainframe"; activePage = this; temp = new CriticalStat("Temp", 60, -0.001F, new Vector2(178, 246), Content.Load<SpriteFont>("MS Quartz")); dist = new CriticalStat("Distance", 1000000, 1, Vector2.Zero, Content.Load<SpriteFont>("MS Quartz")); power = new PowerBoard(Content); vent = new VentBoard(Content); DebugMode.vBoard = vent; o2 = new O2Board(Content); DebugMode.oBoard = o2; man = new Manual(Content); term = new Terminal(Content.Load<SpriteFont>("TerminalFont"), Content.Load<Texture2D>("CompCons"), Content.Load<Texture2D>("Darkness"), o2, ">>"); allPages = new Dictionary<Rectangle, IPage>(); allPages.Add(powerRect, power); allPages.Add(ventRect, vent); allPages.Add(lmcRect, term); allPages.Add(o2Rect, o2); allPages.Add(manRect, man); }
public ActionResult Pages(string actionName) { Manual file = new Manual(); file = manualBL.GetManual(controllerName, actionName); TempData[actionName] = file.ManualBodyHtml; return(View(file)); }
public IHttpActionResult UpdateManual(UpdateManualRequest updateManualRequest) { var responses = new Responses(); try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (Utility.UserId < 0) { return(BadRequest(Utility.INVALID_USER)); } var manual = new Manual() { ManualId = updateManualRequest.ManualId, ManualName = updateManualRequest.ManualName, PDF = updateManualRequest.PDF, ModifiedBy = Utility.UserId }; int result = iManual.UpdateManual(manual); switch (result) { case 1: responses.Status = Utility.SUCCESS_STATUS_RESPONSE; responses.Description = "Manual updated successfully."; break; case -2: responses.Status = Utility.ERROR_STATUS_RESPONSE; responses.Description = "Manual already exists."; break; case -3: responses.Status = Utility.ERROR_STATUS_RESPONSE; responses.Description = "Manual doesn't exist."; break; default: responses.Status = Utility.ERROR_STATUS_RESPONSE; responses.Description = "Error while updating manual."; break; } } catch (Exception ex) { responses.Status = Utility.ERROR_STATUS_RESPONSE; responses.Description = "Error while updating admin profile."; Utility.WriteLog("UpdateManual", updateManualRequest, "Error while updating manual. (ManualAdminController)", ex.ToString()); } return(Ok(responses)); }
public void ManualKonstruktorTest1(string kod, string datum, string id, string potrosnja) { Manual man = new Manual(kod, datum, id, potrosnja); Assert.AreEqual(man.kod, kod); Assert.AreEqual(man.datum, datum); Assert.AreEqual(man.id, id); Assert.AreEqual(man.potrosnja, potrosnja); }
public void Can_create_a_drive_system_containing_same_manual_more_than_once() { var ds = new DriveSystem {Name = "Drive System 1"}; var englishManual = new Manual {Title = "Operation Manual", Language = "English"}; ds.Manuals.Add(englishManual); ds.Manuals.Add(englishManual); ds.Manuals.Add(new Manual {Title = "Operation Manual", Language = "German"}); Session.Save(ds); Session.Flush(); Session.Clear(); // Assertions var fromDb = Session.Get<DriveSystem>(ds.Id); Assert.AreEqual(ds.Manuals.Count, fromDb.Manuals.Count); // Assert that bag can really contain same equipment multiple times var temp = new List<Manual>(fromDb.Manuals); Assert.AreEqual(2, temp.FindAll(m => m.Title == englishManual.Title && m.Language == englishManual.Language).Count); }