Exemplo n.º 1
0
 public BaiDoXe(string name, int soxemax, Server server, BangHienThi banghienthi, Barrier barrier, NhanVien nhanVien)
 {
     this.name           = name;
     this.soxemax        = soxemax;
     this.server         = new Server(server);
     this.server.soxemax = this.soxemax;
     this.b0             = new BangHienThi(banghienthi);
     this.barrier1       = new Barrier(barrier);
     this.nhanVien       = new NhanVien(nhanVien);
 }
Exemplo n.º 2
0
 public Barrier(Barrier x)
 {
     this.status = x.status;
     this.vitri  = x.vitri;
 }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Xe a = new Xe("345", "small", 20000, PhanLoaiXe.XeOto);
            Xe b = new Xe("34325", "small", 2000, PhanLoaiXe.XeMay);

            /* Xe b = new Xe();
             * b.bienSoXe = Console.ReadLine();
             * b.hd = Console.ReadLine();
             * b.tienguixe = int.Parse(Console.ReadLine());
             * string temp = Console.ReadLine();
             * if (temp == "0") b.loaiXe = PhanLoaiXe.XeDap;
             * else if (temp == "1") b.loaiXe = PhanLoaiXe.XeMay;
             * else b.loaiXe = PhanLoaiXe.XeOto; */

            //Thanh phan cua bai xe
            Server      sv        = new Server(500);
            NhanVien    staff     = new NhanVien();
            Barrier     frontGate = new Barrier();
            BangHienThi bang1     = new BangHienThi();
            BaiDoXe     baidx1    = new BaiDoXe("SPKT", 10, sv, bang1, frontGate, staff);

            //event Xe check in & out
            baidx1.EVInOutHandler += NhanVienLog;
            baidx1.EVInOutHandler += baidx1.server.check;
            baidx1.EVInOutHandler += BangHienThiLog;
            baidx1.EVInOutHandler += baidx1.barrier1.BarrierAct;
            baidx1.EVInOutHandler += BarrierLog;

            baidx1.OPEN += EV_OPEN;
            Console.WriteLine(baidx1.moBai()); //event mo bai do xe
            //baidx1.Xevao(a);
            b.In += EV_In;
            Console.WriteLine(b.thongBaoXeVao(b)); //event thong bao xe vao
            baidx1.Xevao(b);
            //baidx1.Xera(a);
            b.Out += EV_Out;
            Console.WriteLine(b.thongBaoXeRa(b)); //event thong bao xe ra
            baidx1.Xera(b);
            //event cai dat 1 camera moi vao bai giu xe
            Camera i = new Camera();

            i.viTriCamera       = "Khu a";
            staff.EVInstallCam += I_EVInstallCam;
            Console.WriteLine(staff.thucThiEVInstallCam(i));

            //event bao tri camera
            staff.evMaintainCam += _evMaintainCam;
            Console.WriteLine(staff.thucThiEVMainTainCam(i));

            //event nhan vien tinh tien thoi va tra cho khach
            staff.EVTinhtienth += Staff_EVTinhtienth;
            Console.WriteLine(staff.thucThiEVTinhTienth(sv, b));
            staff.maNhanVien       = "hxp";
            staff.NgayDiemdanh     = "20";
            staff.songaydadiemdanh = 29;
            staff.NVDiemdanhNgaylamviec(sv);
            foreach (KeyValuePair <string, string> item in sv.DSdiemdanhh)
            {
                Console.WriteLine(item.Key + " " + item.Value);
            }
            //event phat luong
            sv.EVphatLuong += Sv_EVphatLuong;
            sv.thucthiEVphatLuong(staff);

            //event check so ngay diem danh sau khi phat luong
            sv.EVChPhatLuong += Sv_EVChPhatLuong;
            sv.thucthiEVChPhatLuong(staff);

            baidx1.CLOSE += EV_CLOSE;
            Console.WriteLine(baidx1.dongBai()); //event dong bai do xe

            staff.EVMaintainSV += _EVMaintainSV;
            Console.WriteLine(staff.thucThiEVMaintainSV(sv));
        }