using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;

namespace GMW_Term
{
    public partial class reset : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // salvo i dati attuali...
            string lingua = user_std.UtSn.lingua;
            string USER_NAME = SteamWare.memLayer.ML.StringSessionObj("USER_NAME");
            string DOMINIO = SteamWare.memLayer.ML.StringSessionObj("DOMINIO");
            // salvo i valori delle tab in session...
            Dictionary<string, string> sessionParam = SteamWare.memLayer.ML.valSess2SurvUpd;

            // svuoto session e cache per rileggere i dati da Db
            Session.RemoveAll();

            SteamWare.memLayer.ML.flushRegisteredCache();

            // rimemorizzo
            user_std.UtSn.startUpUtente(DOMINIO, USER_NAME);
            user_std.UtSn.lingua = lingua;
            DataWrap.DW.resetVocabolario();

            // risalvo in session i valori...
            foreach (KeyValuePair<string, string> kvp in sessionParam)
            {
                SteamWare.memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true);
            }

            Response.Redirect("Home.aspx");
        }
    }
}