using SteamWare;
using System;

namespace NKC_WF
{
    public partial class Login : BasePage
    {
        protected string _nextPage
        {
            get
            {
                string pagina = memLayer.ML.StringSessionObj("nextPage");
                if (string.IsNullOrEmpty(pagina))
                {
                    pagina = "Home";
                }
                return pagina;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            cmp_login.Login_ok += Cmp_login_Login_ok;
            cmp_login.Login_Error += Cmp_login_Login_Error;
        }

        private void Cmp_login_Login_Error(object sender, EventArgs e)
        {
            Response.Redirect("~/ErrorPages/Oops?aspxerrorpath=Login");
        }

        private void Cmp_login_Login_ok(object sender, EventArgs e)
        {
            Response.Redirect(_nextPage);
        }
    }
}