protected void Page_Load(object sender, EventArgs e)
        {
            Session["bodyid"] = "firstlogin"; //"user-home";

            if (!IsPostBack)
            {
                if (isProfileCompleted())
                {
                    Response.Redirect("Member/MemberHome.aspx");
                }
                else
                {
                    bool flagIsActive = false;
                    //Get the value of isActive
                    if (Convert.ToInt32(Session["isActive"]) > 0)
                        flagIsActive = true;

                    //End getting value isActive
                    if (!string.IsNullOrEmpty(Request.QueryString["userId"]) && !string.IsNullOrEmpty(Request.QueryString["key"]) && !string.IsNullOrEmpty(Request.QueryString["mode"]))
                    {
                        if (Convert.ToInt32(Request.QueryString["mode"].Trim()) == 1)
                            Session["SignUpMode"] = "Facebook logon";
                        else if (Convert.ToInt32(Request.QueryString["mode"].Trim()) == 2)
                            Session["SignUpMode"] = "Manual Sign Up";
                        else
                            Session["SignUpMode"] = "Sign Up";

                        if (!flagIsActive)
                        {
                            SendMail(Convert.ToInt64(Request.QueryString["userId"]));
                            updateUserStatus(Convert.ToInt64(Request.QueryString["userId"]));
                        }

                        AuthenticateUser();
                    }
                    else
                    {
                        Session["SignUpMode"] = Resources.Resource.FirstLogonHeader; //"Sign Up";
                        if (!flagIsActive)
                        {
                            SendMail(Util.UserId);
                            updateUserStatus(Util.UserId);
                        }
                        using (Database db = new MySqlDatabase())
                        {
                            ClientInfo ci = db.GetClientInfo(Util.UserId);
                            Session["UserName"] = ci.GetFullName();
                        }
                    }

                    LogonMode.Text = Convert.ToString(Session["SignUpMode"]);
                    //FirstNameLiteral.Text = Convert.ToString(Session["UserName"]);
                    Dictionary<string, string> param1 = new Dictionary<string, string>();
                    TrackProtect.ParamsDictionary param = new ParamsDictionary();
                    //Replacing value of first Name from inc file.
                    param.Add("VarFirstName", Convert.ToString(Session["UserName"]));
                    IncludePage(ltrFirstLogon, Resources.Resource.FirstLogon, param);

                }

                if (Convert.ToString(Session["culture"]).Contains("nl"))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "HighLightLangBtn", "HighLightLangBtn('" + "ctl00_HeadLoginView_LanguageNL" + "');", true);
                    ClientScript.RegisterStartupScript(this.GetType(), "UnHighLightLangBtn", "UnHighLightLangBtn('" + "ctl00_HeadLoginView_LanguageUS" + "');", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "HighLightLangBtn", "HighLightLangBtn('" + "ctl00_HeadLoginView_LanguageUS" + "');", true);
                    ClientScript.RegisterStartupScript(this.GetType(), "UnHighLightLangBtn", "UnHighLightLangBtn('" + "ctl00_HeadLoginView_LanguageNL" + "');", true);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Logger logger = Logger.Instance;

            IncludePage(BuyProductInc, Resources.Resource.incBuyProduct);
            IncludePage(RhosMovementInc, Resources.Resource.incRhosMovement2);

            string activeModule = string.Empty;

            using (Database db = new MySqlDatabase())
            {
                UserInfo ui = db.GetUser(Util.UserId);
                ClientInfo ci = db.GetClientInfo(Util.UserId);

                DataSet ds = db.GetRegister(Util.UserId);
                int protectedTracks = ds.Tables[0].Rows.Count;

                LoggedOnTitle.Text = Resources.Resource.LoggedOnTitle;
                LoggedOnUserName.Text = string.Format("<span><b>{0}</b></span>", ci.FirstName);// ci.GetFullName());
                CreditsLiteral.Text = Util.GetUserCredits(Util.UserId).ToString();
                ProtectedLiteral.Text = protectedTracks.ToString();
                string userDocPath = db.GetUserDocumentPath(ui.UserId, Session["access"] as string);
                decimal percentComplete = DetermineCompletion(userDocPath, ui, ci);
                CompletedLiteral.Text = string.Empty;
                if (percentComplete < 100)
                    CompletedLiteral.Text = string.Format(Resources.Resource.PercentComplete, percentComplete / 100m);
                divAccPerCompleted.Visible = ClickToLinkLiteral.Visible = (CompletedLiteral.Text != string.Empty);
            }

            if (!IsPostBack)
            {
                long prodid = -1;
                long transid = -1;
                ParamsDictionary parms = new ParamsDictionary();
                string desc = "???";
                if (Request.Params["pid"] != null /* && Request.Params["tid"] == null */)
                {
                    prodid = Convert.ToInt64(Request.Params["pid"]);
                    if (prodid > -1)
                    {
                        using (Database db = new MySqlDatabase())
                        {
                            ProductInfo pi = db.GetProductById(prodid);
                            ProductPriceInfoList ppil = db.GetProductPrices(prodid);
                            decimal price = 0m;
                            foreach (ProductPriceInfo ppi in ppil)
                            {
                                if (ppi.IsoCurrency == "EUR")
                                {
                                    price = ppi.Price;
                                    break;
                                }
                            }

                            desc = pi.Name;
                            parms.Add("{%product%}", desc);
                            parms.Add("{%credits%}", pi.Credits.ToString());
                            parms.Add("{%price%}", string.Format("{0:C}", price));
                        }

                        string _priceInEuro = parms["{%price%}"];

                        if (_priceInEuro.Contains("$"))
                        {
                            parms.Remove("{%price%}");
                            _priceInEuro = _priceInEuro.Replace("$", "€").Replace(".", ",");
                            parms.Add("{%price%}", _priceInEuro);
                        }
                    }
                }

                if (Request.Params["tid"] != null /* && Request.Params["pid"] != null */)
                {
                    transid = Convert.ToInt64(Request.Params["tid"]);
                    if (transid > -1)
                    {
                        using (Database db = new MySqlDatabase())
                        {
                            Transaction transaction = db.GetQuotation(transid);
                            string statuscode = transaction.StatusCode;
                            string[] parts = statuscode.Split('(', ':', ')');
                            int credits = 0;
                            if (parts.Length >= 3)
                                credits = Convert.ToInt32(parts[2]);
                            desc = string.Format(Resources.Resource.BulkPurchase, credits, transaction.Amount);
                            parms.Add("{%product%}", desc);
                            parms.Add("{%credits%}", credits.ToString());
                        }
                    }
                }

                IncludePage(ProductInc, Resources.Resource.incBuyProductText, parms);

                //ProductLiteral.Text = string.Format(Resources.Resource.Purchase1, desc);
            }

            if (Convert.ToString(Session["culture"]).Contains("nl"))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "HighLightLangBtn", "HighLightLangBtn('" + "ctl00_HeadLoginView_LanguageNL" + "');", true);
                ClientScript.RegisterStartupScript(this.GetType(), "UnHighLightLangBtn", "UnHighLightLangBtn('" + "ctl00_HeadLoginView_LanguageUS" + "');", true);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "HighLightLangBtn", "HighLightLangBtn('" + "ctl00_HeadLoginView_LanguageUS" + "');", true);
                ClientScript.RegisterStartupScript(this.GetType(), "UnHighLightLangBtn", "UnHighLightLangBtn('" + "ctl00_HeadLoginView_LanguageNL" + "');", true);
            }
        }