Hey guys...So im using mvc3 to create a database website for a rental system.
in my rental.cs in my model folder it goes like..
<pre lang="c#">public class Rental
{
public int RentalID { get; set; }
public int CustomerID { get; set; }
public int MovieID { get; set; }
public bool? OnHire { get; set; }
// public static bool test;
//On another note i had to take out the 'static' in public statick bool? onhire
as it threw an error when I tried to load the rentals page.
}
The error being:
Line 33: </td>
Line 34: <td>
Line 35: @Html.DisplayFor(modelItem => item.OnHire)
Line 36: </td>
Line 37: <td>
So here I was trying to use a static bool, which will allow me to use it in a different class.
Then in the movies class I was trying to say when the rental.OnHire = true, the movie.onHire will also be true.
The idea being when the user rents out a copy they change the onHire to yes on the rental page, which will change the movie on the movies page from false to true..
<pre lang="sql">
<pre lang="c#">
public class Movie
{
public int MovieID { get; set; }
public string Title { get; set; }
public string Producer { get; set; }
public string Genre { get; set; }
public bool? OnHire { get; set; }
// if (Rental.Onhire)
//{
//OnHire = true;
// }
}
}
</pre></pre>
Although it wasnt picking up the bool. Could someone please advise where I am going wrong. Am I going about this the right way?