// Send Email on Credit purchase
 public PaymentReceipt GetCreditPtTransactionDetails(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     PaymentReceipt objTransactionDetails = new PaymentReceipt();
     objTransactionDetails = objBillingResource.GetCreditPtTransactionDetails(objValue);
     SendCreditPurchaseTransactionEmail(objTransactionDetails);
     //string subject = "";
     //string body = "";
     //SendEmail(objTransactionDetails.TributeId, "subject", "body", "Your Tribute <" + WebConfig.NoreplyEmail + ">");
     return objTransactionDetails;
 }
 public int GetLinkedVideoTributeId(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     return objBillingResource.GetLinkedVideoTributeId(objValue);
 }
 public void GetCreditPointCount(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     objBillingResource.GetCreditPointCount(objValue);
 }
        public PaymentReceipt GetVideoTributeTransactionDetails(object[] objValue)
        {
            BillingResource objBillingResource = new BillingResource();
            PaymentReceipt objTransactionDetails = new PaymentReceipt();
            //if (HttpContext.Current.Session["ViaCreditCard"].Equals(false))
            //{
            objTransactionDetails = objBillingResource.GetVideoTributeTransactionDetails(objValue);
            //}
            //else
            //{
            //objTransactionDetails = objBillingResource.GetTransactionDetails(objValue);

            SendVideoTributeCreationTransactionEmail(objTransactionDetails);
            //string subject = "";
            //string body = "";
            //SendEmail(objTransactionDetails.TributeId, "subject", "body", "Your Tribute <" + WebConfig.NoreplyEmail + ">");
            return objTransactionDetails;
        }
 public IList<CreditCostMapping> GetCreditCostMapping()
 {
     BillingResource objBillingResource = new BillingResource();
     return objBillingResource.GetCreditCostMapping();
 }
 /// <summary>
 /// Method to get the transaction details based on  the package id
 /// </summary>
 /// <param name="objValue">Package id</param>
 /// <returns>Transaction details.</returns>
 public PaymentReceipt GetTransactionDetails(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     PaymentReceipt objTransactionDetails = new PaymentReceipt();
     objTransactionDetails = objBillingResource.GetTransactionDetails(objValue);
     SendTransactionEmail(objTransactionDetails);
     return objTransactionDetails;
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
        {
            topNavigationYM.Visible = true;
            topNavigationYT.Visible = false;
        }

        var fbWebContext = FacebookWebContext.Current;        // get facebook session
        StateManager stateManager = StateManager.Instance;
        SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
        if (!Equals(objSessionvalue, null) && !_section.Equals(HeaderSecionEnum.registration.ToString()))
        {
            spanLogout.InnerHtml = "<a class='logoutLink' id='header_logout' href='Logout.aspx?session=Logout'>Log out</a>";
            int intUserType = objSessionvalue.UserType;
            if (intUserType == 1)
            {
                _userName = objSessionvalue.FirstName;
                lnCreditCount.Visible = false;

            }
            else if (intUserType == 2)
            {
                _userName = objSessionvalue.UserName;
                double NetCreditPoints;
                UserRegistration _objUserReg = new UserRegistration();
                Users objUsers = new Users();
                objUsers.UserId = objSessionvalue.UserId;
                _objUserReg.Users = objUsers;
                object[] param = { _objUserReg };
                BillingResource objBillingResource = new BillingResource();
                objBillingResource.GetCreditPointCount(param);
                UserRegistration objDetails = (UserRegistration)param[0];
                if (objDetails.CreditPointTransaction == null)
                {
                    NetCreditPoints = 0;
                }
                else
                {
                    NetCreditPoints = objDetails.CreditPointTransaction.NetCreditPoints;
                }
                //lbtnCreditCount.Text = "Credits (" + NetCreditPoints.ToString() + ")";
                lnCreditCount.InnerHtml = "Credits (" + NetCreditPoints.ToString() + ")";

            }
            // Added by Ashu on Oct 3, 2011 for rewrite URL
            if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "moments.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "moments.aspx";
            else
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";

            divProfile.Visible = true;
            //spanSignUp.Visible = false;
        }
        else if (!_section.Equals(HeaderSecionEnum.inner.ToString()))
        {
            StringBuilder sbl = new StringBuilder();

            sbl.Append("<a class='yt-horizontalSpacer' href='");
                sbl.Append("log_in.aspx");
            sbl.Append("' >Log in</a>");
            spanLogout.InnerHtml = sbl.ToString();
            divProfile.Visible = false;
        }
        if (fbWebContext.Session == null && objSessionvalue != null)
        {
            StringBuilder sbl = new StringBuilder();
            sbl.Append("<fb:login-button size=\"small\"");
            sbl.Append("\" onlogin=\"doAjaxLogin();\" v=\"2\"><fb:intl>");
            sbl.Append((Equals(objSessionvalue, null) ? "Log in with Facebook" : "Connect"));
            sbl.Append("</fb:intl></fb:login-button>");
            sbl.Append(spanLogout.InnerHtml);

            spanLogout.InnerHtml = sbl.ToString();
        }

        HomeNavValue = "non-current";
        TourNavValue = "non-current";
        FeaturesNavValue = "non-current";
        ExamplesNavValue = "non-current";
        PricingNavValue = "non-current";

        switch (NavigationName)
        {
            case "Home":
                HomeNavValue = "current";
                break;
            case "Tour":
                TourNavValue = "current";
                break;
            case "Features":
                FeaturesNavValue = "current";
                break;
            case "Examples":
                ExamplesNavValue = "current";
                break;
            case "Pricing":
                PricingNavValue = "current";
                break;
            default:
                break;
        }
        //Added to get home url and titleof logo
        string x = HomeUrl();
        x = LogoTitle();
    }
 public void TriputePackageInfo(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     objBillingResource.GetTriputePackageInfo(objValue);
 }
 public void UpdateAutoRenew(object[] Params)
 {
     BillingResource objBillingResource = new BillingResource();
     objBillingResource.UpdateAutoRenew(Params);
 }
        public object SendSponsorEmailOnFreeUpgrade(object[] objValue)
        {
            StringBuilder sb = new StringBuilder();
            UserRegistration objUserReg = new UserRegistration();
            BillingResource objBillingResource = new BillingResource();
            BillingHistory objBilling = new BillingHistory();
            EmailManager objEmailManager = new EmailManager();
            TributePackage objpackage = new TributePackage();
            // return objBillingResource.InsertRecord(objValue);
            UserCreditcardDetails objCCdetail = new UserCreditcardDetails();
            SessionValue objUser = new SessionValue();
            Tributes objTribute = new Tributes();
            String[] SponsorNameandMsgForEmail;

            object identity = new object();
            //using (TransactionScope trans = new TransactionScope())
            //{
            //    identity = objBillingResource.InsertRecord(objValue);
            //    //Transaction Commited
            //    trans.Complete();
            //}
            objUserReg = (UserRegistration)objValue[0];
            if (objValue.Length > 1)
            {
                objUser = (SessionValue)objValue[1];
                objTribute = (Tributes)objValue[2];
                objpackage = (TributePackage)objValue[3];
                SponsorNameandMsgForEmail = (String[])objValue[4];
                // Send the email to all the adminstrator

                if (objpackage.IsSponserHide)
                {
                    if (SponsorNameandMsgForEmail[0] != string.Empty)
                    {
                        objEmailManager.SendSponsorMailsWithMessage(SponsorNameandMsgForEmail[0], SponsorNameandMsgForEmail[1], objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId);
                    }
                 /* commented by Mohit  else if (objpackage.IsSponsor)
                    {
                        objEmailManager.SendSponsorMails(objUser.UserType == 1 ? objUser.UserName : objUser.FirstName, objUser.UserEmail, objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId);
                    } */
                    else
                    {
                        objEmailManager.SendSponsorMails("An anonymous person has", "Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objpackage.EndDate != null ? DateTime.Parse(objpackage.EndDate.ToString()).ToString("MMMM dd, yyyy") : "Never", objpackage.PackageId);
                    }
                    //objEmailManager.SendSponsorMails(objUser.UserName, objUser.UserEmail, objTribute.TributeId, objTribute.TypeDescription, objTribute.TributeName, objTribute.TributeUrl, objUserReg.UserCreditcardDetails.ExpirationDate.ToString("MMMM dd, yyyy"), objpackage.PackageId);

                }
            }

            return identity;
        }
 public int TributePackageId(int tributeId)
 {
     BillingResource objBillingResource = new BillingResource();
     return objBillingResource.GetTributePackageInfo(tributeId);
 }
 public IList<BillingHistory> BillingHistory(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     return objBillingResource.GetBillingHistory(objValue);
 }
        public object InsertPackageDetails(object[] objValue)
        {
            BillingResource objBillingResource = new BillingResource();

            object objBillingReturn = new object();
            using (TransactionScope trans = new TransactionScope())
            {
                objBillingReturn = objBillingResource.InsertPackageDetails(objValue);
                //Transaction Commited
                trans.Complete();
            }
            return objBillingReturn;
        }
        public object InsertCreditPointCCDetails(object[] objValue)
        {
            StringBuilder sb = new StringBuilder();
            UserRegistration objUserReg = new UserRegistration();
            BillingResource objBillingResource = new BillingResource();
            BillingHistory objBilling = new BillingHistory();
            EmailManager objEmailManager = new EmailManager();
            TributePackage objpackage = new TributePackage();
            // return objBillingResource.InsertRecord(objValue);
            UserCreditcardDetails objCCdetail = new UserCreditcardDetails();
            SessionValue objUser = new SessionValue();
            Tributes objTribute = new Tributes();

            object identity = new object();
            using (TransactionScope trans = new TransactionScope())
            {
                identity = objBillingResource.InsertRecord(objValue);
                //Transaction Commited
                trans.Complete();
            }
            return identity;
        }
 public int GetPackIdonPhotoId(int PhotoId)
 {
     BillingResource objBillingResource = new BillingResource();
     return objBillingResource.GetPackIdonPhotoId(PhotoId);
 }
 public void UpdateCreditPointOfVideoTributeOwner(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     objBillingResource.UpdateCreditPointOfVideoTributeOwner(objValue);
 }
 /// <summary>
 /// Method to get the payment receipt based on the tribute package id
 /// </summary>
 /// <param name="objValue">TributePackageId</param>
 /// <returns></returns>
 public IList<PaymentReceipt> GetPaymentReceipt(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     return objBillingResource.GetPaymentReceipt(objValue);
 }
 public void UpdateRecord(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     objBillingResource.UpdateRecord(objValue);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        Ajax.Utility.RegisterTypeForAjax(typeof(UserControl_TributeHeader));
        var fbWebContext = FacebookWebContext.Current.Session;

         StateManager stateManager = StateManager.Instance;
        SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
        if (!Equals(objSessionvalue, null) && !_section.Equals(HeaderSecionEnum.registration.ToString()))
        {
            spanLogout.InnerHtml = "<a id='header_logout' style='cursor:pointer; text-decoration:underline;' onclick='javascript:LogOut();'>Log out</a>";
            int intUserType = objSessionvalue.UserType;
            if (intUserType == 1)
            {
                // _userName = objSessionvalue.FirstName + " " + objSessionvalue.LastName;
                _userName = objSessionvalue.FirstName;
                lnCreditCount.Visible = false;
            }
            else if (intUserType == 2)
            {
                _userName = objSessionvalue.UserName;
                double NetCreditPoints;
                UserRegistration _objUserReg = new UserRegistration();
                Users objUsers = new Users();
                objUsers.UserId = objSessionvalue.UserId;
                _objUserReg.Users = objUsers;
                object[] param = { _objUserReg };
                BillingResource objBillingResource = new BillingResource();
                objBillingResource.GetCreditPointCount(param);
                UserRegistration objDetails = (UserRegistration)param[0];
                if (objDetails.CreditPointTransaction == null)
                {
                    NetCreditPoints = 0;
                }
                else
                {
                    NetCreditPoints = objDetails.CreditPointTransaction.NetCreditPoints;
                }
                //lbtnCreditCount.Text = "Credits (" + NetCreditPoints.ToString() + ")";
                lnCreditCount.InnerHtml = "Credits (" + NetCreditPoints.ToString() + ")";
                Session["_userId"] = objSessionvalue.UserId.ToString();

            }
            // Added by Ashu on Oct 3, 2011 for rewrite URL
            if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "moments.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "moments.aspx";
            else
                myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";

            divProfile.Visible = true;
            spanSignUp.Visible = false;
        }
        else if (!_section.Equals(HeaderSecionEnum.inner.ToString()))
        {
            StringBuilder sbl = new StringBuilder();
            sbl.Append("<a href='");
            if (_section.Equals(HeaderSecionEnum.home.ToString()))
            {
                sbl.Append("log_in.aspx");
            }
            else
            {
                sbl.Append("javascript: void(0);' onclick='UserLoginModalpopupFromSubDomain(location.href,document.title);");
            }
            sbl.Append("'>Log in</a>");

            spanSignUp.Visible = !(_section.Equals(HeaderSecionEnum.registration.ToString()));
            lnRegistration.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() +
                "UserRegistration.aspx";

            spanLogout.InnerHtml = sbl.ToString();
            divProfile.Visible = false;
        }

        if (FacebookWebContext.Current.Session == null || objSessionvalue == null)
        {
            StringBuilder sbl = new StringBuilder();
            sbl.Append("<fb:login-button size=\"small\"");

            if (Equals(objSessionvalue, null))
            {
                //LHK: for non logged in user Do not show Facebook
                //sbl.Append("\" onlogin=\"doAjaxLogin();\" v=\"2\"><fb:intl>");
                //sbl.Append("Log in with Facebook");
            }
            else
            {
                sbl.Append("\" onlogin=\"doAjaxConnect();\" v=\"2\"><fb:intl>");
                sbl.Append("Connect");
            }

            sbl.Append("</fb:intl></fb:login-button>");
            sbl.Append(spanLogout.InnerHtml);

            spanLogout.InnerHtml = sbl.ToString();

        }
        // Set the controls value
        SetControlsValue();
    }
 public void GetCreditCardDetails(object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     objBillingResource.GetCreditCardDetails(objValue);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["TokenId"] != null)
            _tokenId = Request.QueryString["TokenId"].ToString();
        else
        {
            //Response.Redirect("log_in.aspx");
            Response.Redirect(Redirect.RedirectToPage(Redirect.PageList.Inner2LoginPage.ToString()));
        }
        lblMessage.Text = "Video tribute already exists for the selected tribute.";
        lblYes.Text = "Do you want to replace the existing video tribute with the new one?";

        if (!this.IsPostBack)
        {
            lblPhotoTributeYearlyCost.Text = WebConfig.PhotoOneyearAmount;
            lblPhotoTributeLifeTimeCost.Text = WebConfig.PhotoLifeTimeAmount;
            lblTributeYearlyCost.Text = WebConfig.TributeOneyearAmount;
            lblTributeLifeTimeCost.Text = WebConfig.TributeLifeTimeAmount;

            this._presenter.GetTokenDetails();
            this._presenter.GetUserDetails();
            GetSessionValues();
            SetControlVisibility();
            _presenter.GetTributesList();
            StateManager stateManager = StateManager.Instance;
            SessionValue objSessionvalue = (SessionValue)stateManager.Get("objSessionvalue", StateManager.State.Session);
            if (!Equals(objSessionvalue, null) && !_section.Equals(HeaderSecionEnum.registration.ToString()))
            {
                spanLogout.InnerHtml = "<a class='logoutLink' id='header_logout' href='Logout.aspx'>Log out</a>";
                int intUserType = objSessionvalue.UserType;
                if (intUserType == 1)
                {
                    // _userName = objSessionvalue.FirstName + " " + objSessionvalue.LastName;
                    _userName = objSessionvalue.FirstName;
                }
                else if (intUserType == 2)
                {
                    _validityText = "30";
                    _userName = objSessionvalue.UserName;
                    double NetCreditPoints;
                    UserRegistration _objUserReg = new UserRegistration();
                    Users objUsers = new Users();
                    objUsers.UserId = objSessionvalue.UserId;
                    _objUserReg.Users = objUsers;
                    object[] param = { _objUserReg };
                    BillingResource objBillingResource = new BillingResource();
                    objBillingResource.GetCreditPointCount(param);
                    UserRegistration objDetails = (UserRegistration)param[0];
                    if (objDetails.CreditPointTransaction == null)
                    {
                        NetCreditPoints = 0;
                    }
                    else
                    {
                        NetCreditPoints = objDetails.CreditPointTransaction.NetCreditPoints;
                    }
                    //lbtnCreditCount.Text = "Credits (" + NetCreditPoints.ToString() + ")";
                    lnCreditCount.InnerHtml = "Credits (" + NetCreditPoints.ToString() + ")";

                }
                // Added by Ashu on Oct 3, 2011 for rewrite URL
                if (ConfigurationManager.AppSettings["ApplicationType"].ToString().ToLower() == "yourmoments")
                    myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "moments.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "moments.aspx";
                else
                    myprofile.HRef = ConfigurationManager.AppSettings["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";//Session["APP_BASE_DOMAIN"].ToString() + "tributes.aspx";

                divProfile.Visible = true;
                //spanSignUp.Visible = false;
            }
            else if (!_section.Equals(HeaderSecionEnum.inner.ToString()))
            {
                StringBuilder sbl = new StringBuilder();

                sbl.Append("<a class='yt-horizontalSpacer' href='");
                if (_section.Equals(HeaderSecionEnum.home.ToString()))
                {
                    sbl.Append("log_in.aspx");
                }
                else
                {
                    sbl.Append("javascript: void(0);' onclick='UserLoginModalpopupFromSubDomain(location.href,document.title);");
                }
                sbl.Append("'>Log in</a>");

                //spanSignUp.Visible = !(_section.Equals(HeaderSecionEnum.registration.ToString()));
                spanLogout.InnerHtml = sbl.ToString();
                divProfile.Visible = false;
            }
            //LHK:(1:44 PM 2/2/2011) To show price in credits to a Business User
            if (objSessionvalue.UserType == 2)
            {
                lblPhotoTributeYearlyCost.Text = WebConfig.PhotoYearlyCreditCost;
                lblPhotoTributeLifeTimeCost.Text = WebConfig.PhotoLifeTimeCreditCost;
                lblTributeYearlyCost.Text = WebConfig.TributeYearlyCreditCost;
                lblTributeLifeTimeCost.Text = WebConfig.TributeLifeTimeCreditCost;
            }
        }
        //added to handle the session issue on selection of a tribute from the tribute list
        Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", Session.SessionID));
        GetSessionValues();
    }
 public PaymentReceipt GetTransactionDetailsForEmail(int packId, string transactionId, object[] objValue)
 {
     BillingResource objBillingResource = new BillingResource();
     PaymentReceipt objTransactionDetails = new PaymentReceipt();
     objTransactionDetails = objBillingResource.GetTransactionDetails(objValue);
     SendCreationTransactionEmail(packId, transactionId, objTransactionDetails);
     return objTransactionDetails;
 }