Пример #1
0
 public void RemoveCellblockTest()
 {
     Cellblock cellblock = new Cellblock("TestBlock");
     Cell cell = new Cell(4, 4, cellblock);
     cell.CellBlock = null;
     Assert.AreEqual(null, cell.CellBlock);
 }
Пример #2
0
 private void comboBoxAvaCells_SelectionChangeCommitted(object sender, EventArgs e)
 {
     groupBox1.Visible = true;
     cell = cellRepo.GetCellByIndex(Int32.Parse(comboBoxAvaCells.SelectedItem.ToString()));
     txtBoxMaxPop.Text = cell.MaxPop.ToString();
     txtBoxPopulation.Text = cell.Pop.ToString();
 }
Пример #3
0
 public Prisoner(string fName, string lName, string adr, DateTime from, DateTime to, string reason)
 {
     this.FirstName = fName;
     this.LastName = lName;
     this.Adress = adr;
     this.ServeFrom = from;
     this.ServeTo = to;
     this.ServeReason = reason;
     this.PrisonerAssignment = null;
     this.PrisonerCell = null;
 }
Пример #4
0
        public void Add(int maxPop, int pop, Cellblock cellblock)
        {
            LoadCellsFromDatabase();
            Cell cell = new Cell(maxPop, pop, cellblock);

            using (ISession session = NhibernateService.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Save(cell);
                    transaction.Commit();
                }
            }
            LoadCellsFromDatabase();
            Notify();
        }
Пример #5
0
 public void AddCellblockTest()
 {
     Cellblock cellblock = new Cellblock("TestBlock");
     Cell cell = new Cell(4, 4, cellblock);
     Assert.AreEqual("TestBlock", cell.CellBlock.Name);
 }