Checking if a booking can be cancelled or not based on three conditions I have 2 if-else statements that checks whether a booking(object mb) can be cancelled or not. If the current user is an admin or department admin, the booking can be cancelled. However, if the booking has been cancelled, of course, it absolutely cannot be cancelled by anyone.

What I am worried about if the if-else statements can be improved further. Any help would be useful.

foreach (var ub in usersBookings)
{
    MyBookingModel mb = new MyBookingModel();
    mb.bookId = ub.bookingId.ToString() + "+" + ub.startDateTime.ToString();
    mb.bookDate = ub.startDateTime.ToString("dd/MM/yyyy");
    mb.bookSlot = ub.startDateTime.ToString("HH:mm") + " - " + ub.endDateTime.ToString("HH:mm");
    mb.facilityName = ub.facilityName;
    mb.status = ub.bookingStatus.Trim();
    mb.startDateTime = ub.startDateTime.ToString("yyyy-MM-dd HH:mm:00");

    mb.canCancel = false;

    if (mb.status == "Cancelled")
    {  
        //absolute. if mb.status == "Cancelled", mb.canCancel is "false"
        mb.canCancel = false;
        goto add_object;
    }

    if (deptAdmin == true || isAdmin == true)
    {
        mb.canCancel = true;
    }

add_object:
    myBookings.Add(mb);
}
You can simply assign the if conditions to the canCancel property of the MyBookingModel like so  

mb.canCancel = mb.status != "Cancelled" &amp;&amp; ( deptAdmin || isAdmin );




While we are at the properties of the MyBookingModel: Properties should be named using PascalCase casing.  

canCancel -> CanCancel  and so on.  

and while we are at naming things, why is it MyBookingModel and not just BookingModel ? What does the My buy you ?