using System;
using System.Collections.Generic;

using CommonHelpers;

using MyFlat.DB;

namespace MyFlat {

//**************************************************************************************************
/// <summary>
/// Amuzing page model (miscellaneous)
/// </summary>
public class AmusingPageModel {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public readonly PageModelData Data;
[HOptionalValue]
public readonly List<Month_Item>? MonthList;

public PageModelData DataNN => Data.NN();
public List<Month_Item> MonthListNN => MonthList.NN();

//==================================================================================================

public AmusingPageModel(HomeController controller,List<Month_Item> monthList)
{
   Data = new PageModelData( controller );
   MonthList = monthList;
}

public AmusingPageModel(HomeController controller,List<string> errorMessages) =>
   Data = new PageModelData( controller, errorMessages );

public AmusingPageModel(HomeController controller,string errorMessage) =>
   Data = new PageModelData( controller, errorMessage );

//==================================================================================================

public static AmusingPageModel ServerError(HomeController controller,string errorMessage) =>
   new AmusingPageModel( controller, MSG.ServerError( errorMessage ) );

public static AmusingPageModel ServerError(HomeController controller,Exception e) =>
   new AmusingPageModel( controller, MSG.ServerError( e ) );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // AmusingPageModel
//**************************************************************************************************

} // MyFlat
