Ejemplo n.º 1
0
        private void btnAddArea_Click(object sender, EventArgs e)
        {
            AreaAddDialog addAreaDialog = new AreaAddDialog();
            DialogResult  dr            = addAreaDialog.ShowDialog();

            if (dr == DialogResult.OK)
            {
                AreaBLL areaBLL = new AreaBLL();
                Area    area    = areaBLL.CreateArea(addAreaDialog.AreaName);

                // add table
                if (addAreaDialog.IsAddTable)
                {
                    TableBLL tableBLL = new TableBLL();
                    for (var i = addAreaDialog.TableFrom; i <= addAreaDialog.TableTo; i++)
                    {
                        tableBLL.CreateTable(new Table {
                            Name = "Bàn " + i, AreaID = area.ID
                        });
                    }
                }

                this.LoadData();
            }
        }
Ejemplo n.º 2
0
        public void TestCRUDArea()
        {
            string      nameExpected = "BanVIP";
            Area        area         = areaBLL.CreateArea(nameExpected);
            bool        isCreated    = false;
            List <Area> areas        = areaBLL.ListArea();

            for (int i = 0; i < areas.Count; i++)
            {
                if (areas[i].Name == nameExpected)
                {
                    isCreated = true;
                }
            }
            Assert.AreEqual(true, isCreated);
            TestUpdateArea(area);
        }