Пример #1
0
        public void TestStationBLL()
        {
            StationBLL bll = new StationBLL(new StationsDAL());

            Station station1 = new Station("stationA1", new SensorAddress("aa.bb1"), "description", 3);

            bll.Add(station1);

            bll.Delete(station1);

            Station station2 = new Station("stationB3", new SensorAddress("aa.bb7"), "description", 3);
            Station station3 = new Station("stationB3", new SensorAddress("aa.bb8"), "description", 3);

            bll.Add(station2);
            bll.Modify(station2, station3);

            bll.Delete(station3);
            Station station4 = (Station)bll.GetObjById(station3.Name);

            bll.ExcuteSqlStr("select * from station");

            List <object> list1 = bll.GetAllObjs();

            List <object> list2 = bll.GetObjsBySQL("select * from station", null);

            List <Station> list3 = bll.GetStationsByUser(new User("aa"));
        }
Пример #2
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var     rowIndex = dgvStationList.SelectedRows[0].Index;
            Station station  = Get(rowIndex);

            if (station != null)
            {
                if (MessageBox.Show("A je i sigurte", "Jeni duke fshire",
                                    MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    _stationService.Delete(station.ID);
                    RefreshStationList();
                }
            }
        }