CineBook Projekt hinzugefügt
This commit is contained in:
76
Models/Models.cs
Normal file
76
Models/Models.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
|
||||
namespace CineBook.Models;
|
||||
|
||||
public class User
|
||||
{
|
||||
public int UserID { get; set; }
|
||||
public string Username { get; set; } = "";
|
||||
public string PasswordHash { get; set; } = "";
|
||||
public string Role { get; set; } = "User";
|
||||
public string Email { get; set; } = "";
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public bool IsAdmin => Role == "Admin";
|
||||
}
|
||||
|
||||
public class Movie
|
||||
{
|
||||
public int MovieID { get; set; }
|
||||
public string Title { get; set; } = "";
|
||||
public string Genre { get; set; } = "";
|
||||
public int DurationMinutes { get; set; }
|
||||
public string Description { get; set; } = "";
|
||||
public decimal Rating { get; set; }
|
||||
public string PosterUrl { get; set; } = "";
|
||||
public bool IsActive { get; set; } = true;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public string DurationDisplay => $"{DurationMinutes} Min.";
|
||||
public string RatingDisplay => $"★ {Rating:F1}";
|
||||
}
|
||||
|
||||
public class Screening
|
||||
{
|
||||
public int ScreeningID { get; set; }
|
||||
public int MovieID { get; set; }
|
||||
public string MovieTitle { get; set; } = "";
|
||||
public DateTime ScreeningDate { get; set; }
|
||||
public TimeSpan StartTime { get; set; }
|
||||
public string Hall { get; set; } = "";
|
||||
public int TotalSeats { get; set; }
|
||||
public int AvailableSeats { get; set; }
|
||||
public decimal PricePerSeat { get; set; }
|
||||
public string DateTimeDisplay => $"{ScreeningDate:dd.MM.yyyy} {StartTime:hh\\:mm}";
|
||||
public string SeatsDisplay => $"{AvailableSeats}/{TotalSeats} frei";
|
||||
public string PriceDisplay => $"{PricePerSeat:F2} €";
|
||||
}
|
||||
|
||||
public class Seat
|
||||
{
|
||||
public int SeatID { get; set; }
|
||||
public int ScreeningID { get; set; }
|
||||
public string Row { get; set; } = "";
|
||||
public int SeatNumber { get; set; }
|
||||
public bool IsBooked { get; set; }
|
||||
public string Category { get; set; } = "Standard";
|
||||
public string Display => $"{Row}{SeatNumber}";
|
||||
}
|
||||
|
||||
public class Booking
|
||||
{
|
||||
public int BookingID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public string Username { get; set; } = "";
|
||||
public int ScreeningID { get; set; }
|
||||
public string MovieTitle { get; set; } = "";
|
||||
public DateTime ScreeningDate { get; set; }
|
||||
public TimeSpan StartTime { get; set; }
|
||||
public int SeatID { get; set; }
|
||||
public string SeatDisplay { get; set; } = "";
|
||||
public DateTime BookingDate { get; set; }
|
||||
public decimal TotalPrice { get; set; }
|
||||
public string Status { get; set; } = "Confirmed";
|
||||
public string BookingCode { get; set; } = "";
|
||||
public string PriceDisplay => $"{TotalPrice:F2} €";
|
||||
public string DateDisplay => BookingDate.ToString("dd.MM.yyyy HH:mm");
|
||||
public string ScreeningDisplay => $"{ScreeningDate:dd.MM.yyyy} {StartTime:hh\\:mm}";
|
||||
}
|
||||
Reference in New Issue
Block a user