Files
MoonPro.net/MP-Admin/WebUserControls/mod_resetDb.ascx.cs
T
Samuele E. Locatelli 0f8f41aaaa Aggiunto progetto MP-ADMIN
2016-11-11 19:16:20 +01:00

55 lines
1.5 KiB
C#

using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonPro_site.WebUserControls
{
public partial class mod_resetDb : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
checkAuth();
}
private void checkAuth()
{
// se in session è auth alora mostro pannello caricamento..
if (Convert.ToBoolean(Session["isAuthResetDb"]))
{
pnlUpload.Visible = true;
pnlPasswd.Visible = false;
}
else
{
pnlUpload.Visible = false;
pnlPasswd.Visible = true;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
// eseguo la stored di refresh del db
utility.obj.resetDb();
}
protected void txtPwd_TextChanged(object sender, EventArgs e)
{
string _pwdOk = ConfigurationManager.AppSettings.Get("_pdwRefreshDb");
// verifico la password ed eventualmente mostro pannello caricamento..
if (txtPwd.Text != "" && txtPwd.Text == _pwdOk)
{
Session["isAuthResetDb"] = true;
checkAuth();
}
else
{
Session["isAuthResetDb"] = false;
checkAuth();
}
}
}
}