using System;
using System.Reflection;
using System.Threading.Tasks;

using CommonHelpers;

namespace MyFlat {

//**************************************************************************************************
partial class HomeController {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

string IncorrectRequest => HLocal.TEXT(
   "Incorrect request.",
   "Некорректный запрос." );

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

App ProvideWithViewProps() =>
   ProvideWithViewProps( new App( this ) );

/// <exception cref="ArgumentNullException" />
App ProvideWithViewProps(App app)
{
   HArgChecking.VerifyNotNull( app );
   if ( app.IsUserSessionOpen )
   {
      ViewData[ "IsUserSessionOpen" ] = app.IsUserSessionOpen;
      ViewData[ "AccountCode"       ] = app.AccountCode;
      ViewData[ "LoginTime"         ] = app.LoginTime;
      ViewData[ "UserSessionId"     ] = app.UserSessionId;
      ViewData[ "RegistrationDate"  ] = app.SessionData.RegistrationDate;
      ViewData[ "UserInitials"      ] = app.SessionData.UserInitials;
   }
   return app;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // HomeController
//**************************************************************************************************

} // MyFlat
