Пример #1
0
        public void CheckPermission(string licensePlateNumber, string date, string time)
        {
            PermissionCarOnRoadLg permission = new PermissionCarOnRoadLg();
            CarOnRoad             carOnRoad  = new CarOnRoad(licensePlateNumber, date, time);

            bool permissionOnRoad = permission.HasCarPermissionOnRoad(carOnRoad);

            if (permissionOnRoad)
            {
                Console.WriteLine("Car has permission on road");
            }
            else
            {
                Console.WriteLine("Car has not permission on road");
            }
        }
Пример #2
0
        private void btnCheckPermission_Click(object sender, EventArgs e)
        {
            PermissionCarOnRoadLg permission = new PermissionCarOnRoadLg();
            CarOnRoad             carOnRoad  = new CarOnRoad(txtLicensePlateNumber.Text, txtDate.Text, txtTime.Text);

            bool permissionOnRoad = permission.HasCarPermissionOnRoad(carOnRoad);

            if (permissionOnRoad)
            {
                MessageBox.Show("Car has permission on road");
            }
            else
            {
                MessageBox.Show("Car has not permission on road");
            }
        }