示例#1
0
    protected void Page_Init(object sender, EventArgs e)
    {
        bool isLogout = false;
        if (!string.IsNullOrEmpty(Request.QueryString["logout"])
            && bool.TryParse(Request.QueryString["logout"], out isLogout)
            && isLogout)
        { Session["MBRInfo"] = null; }

        if (Session["MBRInfo"] == null
            && !string.IsNullOrEmpty(Request.QueryString["id"]))
        {
            DataAccess.MBR MBRInfo = new DataAccess.MBR();
            DataAccess.AccountManager AccMng = new DataAccess.AccountManager(ConfigurationManager.ConnectionStrings["AISOnetConnectionString"].ConnectionString, int.Parse(ConfigurationManager.AppSettings["TimeOut"]), ConfigurationManager.AppSettings["DBSchema"]);

            MBRInfo = AccMng.GetAccInfo(Request.QueryString["id"]);
            Session["MBRInfo"] = MBRInfo;
        }
    }
示例#2
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        try
        {
            _strURL = Request.Url.AbsoluteUri;
            _strURL = _strURL.Substring(0, _strURL.LastIndexOf("/")+1);

            _strConnectionString = ConfigurationManager.ConnectionStrings["AISOnetConnectionString"].ToString();
            _intTimeOut = int.Parse(ConfigurationManager.AppSettings["TimeOut"].ToString());
            _intLimitQuestionPerWeek = int.Parse(ConfigurationManager.AppSettings["LimitQuestionPerWeek"].ToString());

            _strDBSchema = ConfigurationManager.AppSettings["DBSchema"].ToString();
            _intStartDTOfWeek = int.Parse(ConfigurationManager.AppSettings["StartDTOfWeek"].ToString());
            _DTStartDTcampaign = DateTime.Parse(ConfigurationManager.AppSettings["StartDTcampaign"].ToString());

            Session["Profile"] = "1234567890123";//"1769900161663"; // Fix For Test

            if (Session["Profile"] != null)
            {
                string strPersonalID = (string)Session["Profile"];

                DataAccess.AccountManager AccMng = new DataAccess.AccountManager(_strConnectionString, _intTimeOut, _strDBSchema);
                _MBRInfo = AccMng.GetAccInfo(strPersonalID);

                if (_MBRInfo != null)
                {
                    Session["MBRInfo"] = _MBRInfo;
                }

            }

        }
        catch
        {
            Response.Redirect("Error.aspx");
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            int intMBRID = 0;
            string strVerfCD = "";

            if (string.IsNullOrEmpty(Request.QueryString["MBRID"]))
            {
                intMBRID = 0;
            }
            else
            {
                intMBRID = int.Parse(Request.QueryString["MBRID"]);
            }

            if (string.IsNullOrEmpty(Request.QueryString["VerfCD"]))
            {
                strVerfCD = "";
            }
            else
            {
                strVerfCD = Request.QueryString["VerfCD"];
            }

            if (intMBRID == 0)
            {
                Response.Redirect("Home.aspx",false);
            }
            else
            {

                DataAccess.AccountManager AccMng = new DataAccess.AccountManager(_strConnectionString, _intTimeOut, _strDBSchema);
                if (AccMng.ActivateCode(intMBRID, strVerfCD) == true)
                {
                    lbMessage.Text = "Activate ����� ��س����ѡ����";
                    Response.AddHeader("REFRESH", "5;URL=Home.aspx");
                }
                else
                {
                    //lbMessage.Text = "������!! Activate �������� ��س����ѡ����";
                    string strJavaScriptErrorMsg = "";
                    string strErrorMsg = "��ͼԴ��Ҵ! �������ö Activate ��";
                    strJavaScriptErrorMsg = "<script language='javascript'> alert('" + strErrorMsg + "');location = 'Home.aspx'</script>";
                    //strJavaScriptErrorMsg = "<script language='javascript'> alert('" + strErrorMsg + "');</script>";
                    //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Error", strJavaScriptErrorMsg);
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", strJavaScriptErrorMsg, false);

                }

            }

        }
        catch
        {
            string strJavaScriptErrorMsg = "";
            string strErrorMsg = "��ͼԴ��Ҵ! �������ö Activate ��";
            strJavaScriptErrorMsg = "<script language='javascript'> alert('" + strErrorMsg + "');location = 'Home.aspx'</script>";
            //strJavaScriptErrorMsg = "<script language='javascript'> alert('" + strErrorMsg + "');</script>";
            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Error", strJavaScriptErrorMsg);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", strJavaScriptErrorMsg, false);

        }
    }