Status of sale in C#

Asked

Viewed 46 times

-3

Good afternoon guys, all right?

I am creating a car rental system in C# and would like to implement a function that returns me all cars and a column that shows whether the requested car is leased or not, if it is leased, the ball would be green and otherwise, the red ball and that would automatically change when making the lease. I have researched in several places no longer find, Follow below an example:

inserir a descrição da imagem aqui

The query I can do, the problem is this variable STATUS

  • 2

    It is necessary that you show what you have already done, missing code, example, data structure, interface code, be more limited

  • I need more details friend. Where you get this information and in what type of GUI you intend to present this information?

1 answer

-1

There are several ways to do this check, for example, using 0 for unavailable and 1 for available, create a function that changes the status of this variable to the rental car from 0 to 1. Then just add this value in the table that mounted status.

You can also use lib bool which is based on the same principle, only using true and false.Example:

#include<stdbool.h>

bool setStatus(carro){
    if(carro == Alugado){
        return true;
    }
    return false;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.