コード例 #1
0
 public void WriteFooter()
 {
     switch(this.m_contactType)
     {
         case (int)OTCContactType.BetterManContact :
             ITCPageBetterMan page1 = new ITCPageBetterMan();
             page1.End();
             break;
         case (int)OTCContactType.BetterManWin3 :
             ITCPageBetterMan page2 = new ITCPageBetterMan();
             page2.End();
             break;
         case (int)OTCContactType.BetterWomanContact :
             ITCPageBetterWoman page3 = new ITCPageBetterWoman();
             page3.End();
             break;
         case (int)OTCContactType.BetterWomanWin3 :
             ITCPageBetterWoman page4 = new ITCPageBetterWoman();
             page4.End();
             break;
         case (int)OTCContactType.InterceuticalsContact :
             ITCPage page5 = new ITCPage();
             page5.End();
             break;
         case (int)OTCContactType.NewsLetter :
             ITCPageBetterMan page6 = new ITCPageBetterMan();
             page6.End();
             break;
     }
 }
コード例 #2
0
ファイル: Links.aspx.cs プロジェクト: mcuellar/interceuticals
 private void Page_Load(object sender, System.EventArgs e)
 {
     this.m_page = new ITCPage();
     if(!(this.m_page.CheckLogin()))
         Response.Redirect("Login.aspx");
     this.m_page.HideWest = true;
 }
コード例 #3
0
ファイル: Order.aspx.cs プロジェクト: mcuellar/interceuticals
        private void Page_Load(object sender, System.EventArgs e)
        {
            int orderId       = 0;
            string verisignId = "";
            string sql        = "";

            this.m_page = new ITCPage();
            this.m_page.HideWest = true;;
            this.m_page.CheckLogin();

            try
            {
                orderId = Convert.ToInt32(Request.QueryString["OID"]);
                sql = "spGetOTCSalesOrderDetails @OTCSalesOrderId = " + orderId;
            }
            catch(System.FormatException)
            {
                verisignId = Request.QueryString["OID"];
                sql = "spGetOTCSalesOrderDetails @VerisignId = " + OTCDatabase.SqlFormat(verisignId) + ",@IsVerisign=1";
            }

            this.m_db.Open();
            DataSet ds = this.m_db.GetDataset(sql);
            this.m_db.ReleaseConnection();
            this.m_page.OpenHeader();
            this.m_page.CloseHeader();
            this.m_page.Start();
            Response.Write("<br><br>");
            OTCGrid grid = new OTCGrid(ds.Tables[0]);
            grid.RandomHTML = "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td class=\"tableFont\">Sales Order ID: " + (orderId > 0 ? orderId.ToString() : verisignId) + ": USER DETAIL</td><td align=\"right\" class=\"tableFont\"><a href=\"javascript:window.history.back(false)\"><< back</a></td></tr></table>";
            grid.Draw();

            Response.Write("<br>");
            grid = new OTCGrid(ds.Tables[1]);
            grid.RandomHTML = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"tableFont\">Sales Order ID: " + (orderId > 0 ? orderId.ToString() : verisignId)+ ": PRODUCT DETAILS</td></tr></table>";
            grid.Draw();

            Response.Write("<br>");

            grid = new OTCGrid(ds.Tables[2]);
            grid.RandomHTML = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"tableFont\">Sales Order ID: " + (orderId > 0 ? orderId.ToString() : verisignId) + ": SHIPPING DETAILS</td></tr></table>";
            grid.Draw();

            Response.Write("<br>");

            grid = new OTCGrid(ds.Tables[3]);
            grid.RandomHTML = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"tableFont\">Sales Order ID: " + (orderId > 0 ? orderId.ToString() : verisignId) + ": CREDIT CARD INFORMATION</td></tr></table>";
            grid.Draw();

            Response.Write("<br>");

            grid = new OTCGrid(ds.Tables[4]);
            grid.RandomHTML = "<table cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"tableFont\">Sales Order ID: " + (orderId > 0 ? orderId.ToString() : verisignId) + ": Marketing Information</td></tr></table>";
            grid.Draw();

            this.m_page.End();
        }
コード例 #4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                this.m_page = new ITCPage();
                OTCShoppingCart cart = new OTCShoppingCart(Session.SessionID);
                Session["wantsMembership"] = Convert.ToBoolean(Request.QueryString["wantsMembership"]);
                int productId = getCorrectProductId(Convert.ToInt32(Request.QueryString["PID"]));
                bool addedItems = false;
                string f = Request.Form.ToString();
                cart = new OTCShoppingCart(this.m_page.ShoppingCartId);
                //cart.RemoveAllItems(this.m_page.ShoppingCartId);
                OTCShoppingCartItem item = new OTCShoppingCartItem();
                OTCProduct product = new OTCProduct(Convert.ToInt32(productId));
                item.ProductID = Convert.ToInt32(productId);
                item.ProductPrice = product.Price;
                item.ItemCount = 1;
                cart.AddCartItem(item);
                string key = "";

                string host = Request.ServerVariables["HTTP_HOST"];

                if (host.IndexOf("localhost") > -1 || host == "cjeycjey.homedns.org:9001" || host == "68.14.68.91:40401")
                    Response.Redirect("/interceuticals/order/precheckout.aspx?" + Request.QueryString.ToString() + "&PID2=" + productId + "&SCID=" + this.m_page.ShoppingCartId + "&site=" + Session["site"] + "&" + (key.Length > 0 ? "?PKY=" + key : ""));
                else if (host == "interceuticals.serveronline.net")
                    Response.Redirect("http://interceuticals.serveronline.net/interceuticals/order/precheckOut.aspx?" + Request.QueryString.ToString() + "&PID2=" + productId + "&SCID=" + this.m_page.ShoppingCartId + "&site=" + Session["site"] + "&" + (key.Length > 0 ? "?PKY=" + key : ""));
                else
                    Response.Redirect("https://www.interceuticals.com/interceuticals/order/precheckout.aspx?" + Request.QueryString.ToString() + "&PID2=" + productId + "&SCID=" + this.m_page.ShoppingCartId + "&site=" + Session["site"] + "&" + (key.Length > 0 ? "?PKY=" + key : ""));
            }
            catch(System.Web.HttpUnhandledException ex)
            {
                string mailBody = Request.QueryString.ToString();

                EmailSender mail = new EmailSender();

                String subject = "Site Error : " + Request.QueryString["PID"];
                String notifyEmails = AppLookup.RecipientsAlerts;

                mail.AddEmailAddresses(notifyEmails);
                mail.SendEmail(subject, mailBody + (char)10 + ex.Message);

                Response.Write("There was an error in our process. We apologize for the inconvenience. We have notified the web master and the problem will be addressed shortly.");
            }
        }
コード例 #5
0
ファイル: X.aspx.cs プロジェクト: mcuellar/interceuticals
 private void Page_Load(object sender, System.EventArgs e)
 {
     this.m_page = new ITCPage();
 }
コード例 #6
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();

            if(!(this.m_page.CheckLogin()))
                Response.Redirect("Login.aspx");

            this.m_page.HideWest = true;
            this.m_promotionId = Request.QueryString.ToString().IndexOf("PID") > - 1 ? Convert.ToInt32(Request.QueryString["PID"]) : 0;
            this.m_promotion   = new OTC.Web.Promotion.OTCPromotion(this.m_promotionId);
            if(!Page.IsPostBack)
            {
                if(!(this.m_promotionId > 0))
                {
                    this.cldStartDate.SelectedDate = this.cldStartDate.VisibleDate = System.DateTime.Now;
                    this.cldEndDate.SelectedDate = this.cldEndDate.VisibleDate = System.DateTime.Now;
                    this.txtStartDate.Text = this.cldStartDate.SelectedDate.ToShortDateString();
                    this.txtEndDate.Text = this.cldEndDate.SelectedDate.ToShortDateString();
                    this.loadProductList();
                }
                else
                {
                    OTC.Web.Promotion.OTCPromotion p = new OTC.Web.Promotion.OTCPromotion(this.m_promotionId);
                    this.txtPromotionId.Value = p.OTCPromotionId.ToString();
                    this.txtStartDate.Text = p.StartDate.ToShortDateString();
                    this.cldStartDate.SelectedDate = this.cldStartDate.VisibleDate = p.StartDate;
                    this.txtPromotionName.Text = p.PromotionName;
                    this.txtPromotionKey.Text = p.PromotionKey;
                    this.txtPromotionDescription.Value = p.PromotionDescription;
                    this.txtMinimumPurchaseAmount.Text = p.MinimumPurchaseAmount.ToString();
                    this.txtEndDate.Text = p.EndDate == Convert.ToDateTime("1/1/1900") ? "" : p.EndDate.ToShortDateString();
                    this.cldEndDate.SelectedDate = this.cldEndDate.VisibleDate = (p.EndDate == Convert.ToDateTime("1/1/1900") ? System.DateTime.Now : p.EndDate);
                    this.txtNumberOfUses.Text = p.UsageCount.ToString();
                    this.txtDiscountPercentage.Text = (p.DiscountPercentage * 100).ToString();
                    this.txtDiscountPercentage.Enabled = p.DiscountPercentage > 0 ? true : false;
                    this.chkActivateImmedietly.Checked = p.IsActive;
                    this.chkDiscountAmount.Checked = p.DiscountAmount > 0;
                    this.txtDiscountAmount.Text = Convert.ToDouble(p.DiscountAmount).ToString("c").Replace("$","");
                    this.txtDiscountAmount.Enabled = p.DiscountAmount > 0 ? true : false;
                    this.chkDiscountPercentage.Checked = p.DiscountPercentage > 0;
                    this.loadProductList(true);
                }
            }
        }
コード例 #7
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_thread = Request.QueryString.ToString().IndexOf("thread") > -1 ? Request.QueryString["thread"] : "";

            if(this.m_thread == "delete")
                this.doDelete();

            char CR = (char)10;
            int counter = 0;
            this.m_db.Open();
            DataSet ds    = this.m_db.GetDataset("spGetOTCPromotionList");
            DataTable dt  = ds.Tables[0];
            DataTable dt2 = ds.Tables[1];
            this.m_db.ReleaseConnection();

            this.m_page = new ITCPage();

            if(!(this.m_page.CheckLogin()))
                Response.Redirect("Login.aspx");

            this.m_page.HideWest = true;
            this.m_page.OpenHeader();
            this.m_page.CloseHeader();
            this.m_page.Start();

            Response.Write("<table border=\"0\" width=\"725\">" + CR
                    + CR + " <tr>"
                    + CR + "  <td colspan=\"2\"><table title=\"click here to add new promotion\" class=\"toolbarButton\" onclick=\"javascript:addNew()\"><tr><td>Add New Promotion</td><td><img src=\"/interceuticals/images/add.gif\"></td></tr></table></td>"
                    + CR + " </tr>"
                    + CR + " <tr valign=\"top\">"
                    );
            foreach(DataRow dr in dt.Rows)
            {
                Response.Write("  <td>" + CR);
                this.buildPromotionSquare(dr,dt2.Select("OTCPromotionId = " + dr["OTCPromotionID"].ToString()));
                Response.Write("  </td>" + CR);
                counter ++;
                if(counter > 1)
                {
                    counter = 0;
                    Response.Write("  </tr>"
                            + CR + "  <tr>"
                            + CR + "   <td colspan=\"2\">&nbsp;</td>"
                            + CR + "  </tr>"
                            + CR + "  <tr>"
                            );
                }
            }
            Response.Write(" </tr>"
                    + CR + "</table>" + CR);

            this.m_page.End();
        }
コード例 #8
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //loadJavaScript();

            Session["site"] = this.m_site = Request.QueryString.ToString().IndexOf("site") > - 1 ? Request.QueryString["site"] : "bm";
            this.m_googleTrackingCode = (this.m_site == "bm" ? "UA-1185020-2" : "UA-1185020-1");
            this.m_preselectedProduct = Request.QueryString.ToString().IndexOf("PID")  > - 1 ? Convert.ToInt32(Request.QueryString["PID"]) : 0;
            this.m_thread = Request.QueryString.ToString().IndexOf("thread") > - 1 ? Request.QueryString["thread"] : "";
            this.m_page = new ITCPage();

            this.chkAutoship.Attributes.Add("onClick", "changeAutoShipState()");
            //this.chkNotAutoship.Attributes.Add("onClick", "changeNotAutoShipState()");

            Log.InfoFormat("Starting order for product id: {0}", m_preselectedProduct.ToString());

            if(!Page.IsPostBack)
            {
                if(this.m_thread == "test")
                    this.txtPromotionCode.Text = Request.QueryString["PKEY"];

                OTCDatabase db = new OTCDatabase();
                string categoryId = this.m_site == "bm" ? "21" : "22";
                db.Open();
                this.m_dt = db.GetDataset("spGetINT_VisibleProducts " + categoryId).Tables[0];
                db.ReleaseConnection();

                OTCShoppingCart cart = new OTCShoppingCart(Session.SessionID);

                bool haveSelection = false;

                foreach(DataRow dr in this.m_dt.Rows)
                {
                    ListItem item = new ListItem(dr["DisplayText"].ToString(),dr["OTCProductId"].ToString());
                    if(cart.CartContainsProduct(Convert.ToInt32(item.Value)) || cart.CartContainsProduct(Convert.ToInt32(dr["OTCSubordinateProductId"]))){
                        if(!haveSelection)
                            item.Selected = true;
                        haveSelection = true;
                    }
                    if(!ddProducts.Items.Contains(item))
                        this.ddProducts.Items.Add(item);
                }

                if(Convert.ToBoolean(Session["wantsMembership"]))
                    this.chkAutoship.Checked = true;

                string file = Request.ServerVariables["APPL_PHYSICAL_PATH"] + "Product\\MembershipHTML\\" + this.ddProducts.SelectedValue + ".htm";
                OTCHtmlReader reader = new OTCHtmlReader(file);
                this.m_membershipHTML = reader.HTML;

                DirectoryInfo dInfo = new DirectoryInfo(Request.ServerVariables["APPL_PHYSICAL_PATH"] + "Product\\MembershipHTML\\");

                foreach(FileInfo f in dInfo.GetFiles())
                {
                    reader = new OTCHtmlReader(f.FullName);
                    this.m_hiddenDivs += "<div id=\"div" + f.Name.Replace(".htm","") + "\" class=\"hidden\">" + reader.HTML + "</div>" + CR;
                }
            }
        }
コード例 #9
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();
            //if(!(this.m_page.CheckLogin()))
            //	Response.Redirect("interceuticals/admin/login.aspx");

            this.m_productId = Request.QueryString.ToString().IndexOf("PID") > - 1 ? Convert.ToInt32(Request.QueryString["PID"]) : 0;

            if(Page.IsPostBack)
                this.m_sortChar = this.txtSortChar.Value;
            else
            {
                this.m_sortChar = Request.QueryString.ToString().IndexOf("sort") > - 1 ? Request.QueryString["char"] : "A";
                this.txtSortChar.Value = this.m_sortChar;
                this.fillListBoxes();
                if(this.m_productId > 0)
                    this.fillForm(sender,e);
            }
        }
コード例 #10
0
ファイル: Login.aspx.cs プロジェクト: mcuellar/interceuticals
 private void Page_Load(object sender, System.EventArgs e)
 {
     this.m_page = new ITCPage();
     this.m_page.HideWest = true;
 }
コード例 #11
0
        //==================================
        //
        //==================================
        private void Page_Load(object sender, System.EventArgs e)
        {
            string strCookieValue = "";

            this.m_isCSV = Request.QueryString.ToString().IndexOf("csv") > -1;

            //Grab the cookie
            HttpCookie cookie = Request.Cookies["ExportToExcel"];

            //Check to make sure the cookie exists
            if (null != cookie)
            {
                //Write the cookie value
                strCookieValue = cookie.Value.ToString();
            }
            if(strCookieValue == "true")
                this.m_isCSV = true;

            if(this.m_isCSV)
                Response.ContentType = "text/plain";

            this.m_page  = new ITCPage();
            this.m_page.HideWest = true;

            //if(!(this.m_page.CheckLogin()))
            //	Response.Redirect("/interceuticals/admin/login.aspx");

            DataRow[] rows;
            this.m_reportId      = Convert.ToInt32(Request.QueryString["RID"]);
            this.m_partnerId     = Request.QueryString.ToString().IndexOf("PID") > - 1 ? Convert.ToInt32(Request.QueryString["PID"]) : 0;
            this.m_lineOrderId   = Request.QueryString.ToString().IndexOf("LID") > - 1 ? Convert.ToInt32(Request.QueryString["LID"]) : 0;
            this.m_report        = new OTCReport(this.m_reportId);
            this.m_startDate     = Convert.ToDateTime(Request.QueryString["STD"]);
            this.m_endDate       = Convert.ToDateTime(Request.QueryString["EDT"]);
            this.m_sortColumn    = Request.QueryString.ToString().IndexOf("sort")  > -1 ? Request.QueryString["sort"] : "";
            this.m_sortDirection = Request.QueryString.ToString().IndexOf("dir")  > -1 ? Request.QueryString["dir"] : "DESC";
            this.m_db.Open();

            string sql = this.m_report.SQL + " "
                + "@startDate = " + OTCDatabase.SqlFormat(this.m_startDate.ToShortDateString())+ ","
                + "@endDate = " + OTCDatabase.SqlFormat(this.m_endDate.ToShortDateString())
                ;

            //bool bla = (report.ReportRestrictions & (int)EDGAReport.Restriction.PartnerSpecific) > 0;

            //if((this.m_report.ReportRestrictions & (int)EDGAReport.Restriction.PartnerSpecific) > 0 && this.m_partnerId > 0)
            //	sql += ", @partnerId = " + this.m_partnerId;
            //if((this.m_report.ReportRestrictions & (int)EDGAReport.Restriction.LineOrderSpecific) > 0 && this.m_lineOrderId > 0)
            //	sql += ", @lineOrderNumber = " + this.m_lineOrderId;

            DataTable dt = this.m_db.GetDataset(sql,3600).Tables[0];
            this.m_db.ReleaseConnection();
            //this.m_page.PageMenu = this.buildMenu();
            //this.m_page.MainMenuVisible = true;
            this.m_page.CheckLogin();

            if(!(this.m_isCSV))
            {
                this.m_page.OpenHeader();
                this.m_page.CloseHeader();
                this.m_page.Start();
            }

            //Complete hack. I need to fix this.
            string genericFilter = dt.Columns.Contains("Order Number") ? "[Order Number] > 0" : "[SortEm] > 0";

            if(this.m_sortColumn.Length > 0)
                rows = dt.Select(genericFilter, this.m_sortColumn + " " + this.m_sortDirection);
            else
                rows = dt.Select();

            if(this.m_isCSV)
                this.buildExcelFile(dt,rows);
            else
                this.buildGrid(dt,rows);

            if(!(this.m_isCSV))
                this.m_page.End();

            Response.End();
        }
コード例 #12
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();
            if(!Page.IsPostBack)
            {
                string sql = "SELECT * FROM OTCPromotion";
                this.m_db.Open();
                DataTable dt = this.m_db.GetDataset(sql).Tables[0];
                foreach(DataRow dr in dt.Rows){
                    ListItem i = new ListItem(dr["PromotionKey"].ToString(),dr["OTCPromotionId"].ToString());
                    this.ddPromotions.Items.Add(i);
                }

                sql = "SELECT * FROM OTCProduct";
                dt = this.m_db.GetDataset(sql).Tables[0];
                foreach(DataRow dr in dt.Rows){
                    ListItem i = new ListItem(dr["ProductName"].ToString() + " - " + Convert.ToDouble(dr["Price"]).ToString("c") ,dr["OTCProductId"].ToString());
                    this.lstProducts.Items.Add(i);
                }
                this.m_db.ReleaseConnection();

            }
        }
コード例 #13
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     this.m_page = new ITCPage();
     Session["site"] = this.m_site = Request.QueryString.ToString().IndexOf("site") > - 1 ? Request.QueryString["site"] : "bm";
 }
コード例 #14
0
 //==================================
 //
 //==================================
 private void Page_Load(object sender, System.EventArgs e)
 {
     this.m_page = new ITCPage();
     this.m_page.HideWest = true;
     if(!(this.m_page.CheckLogin()))
         Response.Redirect("/interceuticals/admin/login.aspx");
     this.m_page.OpenHeader();
     this.m_page.CloseHeader();
     this.m_page.Start();
     this.m_db.Open();
     DataTable dt = this.m_db.GetDataset("spGetOTCReports @OTCSiteId = 7").Tables[0];
     this.m_db.ReleaseConnection();
     this.buildAvailableReports(dt);
     this.m_page.End();
 }
コード例 #15
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();
            this.m_page.HideWest = true;

            if(!(this.m_page.CheckLogin()))
                Response.Redirect("/interceuticals/admin/login.aspx");

            if(!Page.IsPostBack)
            {
                this.m_thread = Request.QueryString.ToString().IndexOf("thread") > - 1 ? Request.QueryString["thread"] : "";
                switch(this.m_thread)
                {
                    case "AC":
                        OTCDatabase db = new OTCDatabase();
                        db.Open();
                        int reportId = Convert.ToInt32(db.GetDataset("SELECT EngagementReportId FROM EngagementReport WHERE SQL = 'spGetReport_CoordinatorDocument'").Tables[0].Rows[0]["EngagementReportId"]);
                        db.ReleaseConnection();
                        string lineOrderNumber = Request.QueryString["LON"];
                        Response.Write(reportId + " " + lineOrderNumber);
                        Response.Redirect("default.aspx?RID=" + reportId + "&LON=" + lineOrderNumber);
                        break;
                }

                DateTime startDate  = Convert.ToDateTime(System.DateTime.Now.Month.ToString() + "/1/" + System.DateTime.Now.Year.ToString());
                DateTime endDate    = System.DateTime.Now.AddDays(1);
                this.txtReportTypeId.Value = Request.QueryString["RID"];
                OTCReport report = new OTCReport(Convert.ToInt32(Request.QueryString["RID"]));
                this.lblReportHeader.Text = report.OTCReportName;
                this.lblDescription.Text = report.OTCReportDescription;
                this.cldStartDate.VisibleDate = startDate;
                this.cldEndDate.VisibleDate = endDate;
                this.cldStartDate.SelectedDate = startDate;
                this.cldEndDate.SelectedDate = endDate;
                ///his.ddLineOrders.Visible = false;
                //this.ddPartner.Visible = false;

                string strCookieValue = "";

                //Grab the cookie
                HttpCookie cookie = Request.Cookies["ExportToExcel"];

                //Check to make sure the cookie exists
                if (null != cookie)
                {
                    //Write the cookie value
                    strCookieValue = cookie.Value.ToString();
                }
                if(strCookieValue == "true")
                    this.chkExport.Checked = true;

                /*
                if((report.ReportRestrictions & (int)EDGAReport.Restriction.PartnerSpecific) > 0)
                {
                    this.ddPartner.Visible = true;
                    this.ddPartner.Fill();
                }

                if((report.ReportRestrictions & (int)EDGAReport.Restriction.LineOrderSpecific) > 0)
                {
                    this.ddLineOrders.Visible = true;
                    this.ddLineOrders.Fill();
                    if(Request.QueryString.ToString().IndexOf("LON") > - 1){
                        string lineOrderNumber = Request.QueryString["LON"];
                        this.ddLineOrders.SetActiveItem(lineOrderNumber);
                        this.ddLineOrders.Enabled = false;
                        BTG.ITPaper.BTGLineOrder lineOrder = new BTG.ITPaper.BTGLineOrder(Convert.ToInt32(lineOrderNumber));
                        this.cldStartDate.VisibleDate = lineOrder.StartDate;
                        this.cldEndDate.VisibleDate = System.DateTime.Now;
                        this.cldStartDate.SelectedDate = lineOrder.StartDate;
                        this.cldEndDate.SelectedDate = System.DateTime.Now;
                    }
                }
                */
            }
        }
コード例 #16
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            string siteName = Request.QueryString.ToString().IndexOf("site") > - 1 ? Request.QueryString["site"] : "bm";
            OTCEncryption crypt = new OTCEncryption(7);
            int id = Convert.ToInt32(Request.QueryString["OID"]);
            this.m_order  = new OTCSalesOrder(id);
            this.m_member = new OTCSiteMember(this.m_order.OTCSiteMemberId);
            this.m_card   = new OTCCreditCard(this.m_order.OTCSalesOrderId,Session.SessionID);

            if(this.m_card.IISSessionId != Session.SessionID)
                Response.Redirect("/interceuticals/index.html");

            this.m_page   = new ITCPage();
            this.m_db.Open();
            this.m_dt	  = this.m_db.GetDataset("spGetOTCSalesOrderDetails_Verisign @OTCSalesOrderId = " + id).Tables[1];

            foreach(DataRow dr in this.m_dt.Rows)
            {
                this.m_product += dr["ProductName"].ToString();
            }

            this.m_db.ReleaseConnection();

            //hack to finish and get deployed.
            string sql = "SELECT * FROM OTCSalesOrderDetail WHERE OTCSalesOrderId = " + this.m_order.OTCSalesOrderId;
            OTCDatabase db = new OTCDatabase();
            db.Open();
            DataTable dt = db.GetDataset(sql).Tables[0];
            db.ReleaseConnection();

            //this.m_siteString = "|BM|BetterMan|Male|";
            //UTM:T|<%=Order.OTCSalesOrderId%>|<%=this.SiteName%>|<%=Order.TotalCost%>|<%=Convert.ToDouble(ProductPrice * Order.SalesTax).ToString("c").Replace("$","")%>|<%=Order.ShippingCost%>|<%=Order.City%>|<%=Order.State%>|<%=Order.Country%> UTM:I|<%=Order.OTCSalesOrderId%><%=this.SiteString%><%=ProductPrice%>|<%=ProductQty%>
            this.m_siteName = siteName == "bm" ? "BetterManNow" : "BetterWomanNow";
            //this.m_googleTrackingCode	= this.m_page.AnalyticsTracking;

            foreach(DataRow dr in dt.Rows)
            {
                int productId = Convert.ToInt32(dr["OTCProductId"]);
                OTCProduct p = new OTCProduct(productId);
                if(p.CategoryId == 21){
                    this.m_siteString += "UTM:T|" + Order.OTCSalesOrderId + "|" + this.SiteName + "|" + Order.TotalCost + "|" + Convert.ToDouble(ProductPrice * Order.SalesTax).ToString("c").Replace("$","") + "|" + Order.ShippingCost + "|" + Order.City + "|" + Order.State + "|" + Order.Country + "UTM:I|" + Order.OTCSalesOrderId + "|BM|BetterMan|Male|" + ProductPrice + "|" + ProductQty  + (char)10;//"|BM|BetterMan|Male|";
                    //this.m_siteName   = "BetterManNow";
                    //this.m_googleTrackingCode = "UA-1185020-2";
                } else {
                    //this.m_siteString = "|BW|BetterWoman|Female|";
                    this.m_siteString += "UTM:T|" + Order.OTCSalesOrderId + "|" + this.SiteName + "|" + Order.TotalCost + "|" + Convert.ToDouble(ProductPrice * Order.SalesTax).ToString("c").Replace("$","") + "|" + Order.ShippingCost + "|" + Order.City + "|" + Order.State + "|" + Order.Country + "UTM:I|" + Order.OTCSalesOrderId + "|BW|BetterWoman|Female|" + ProductPrice + "|" + ProductQty + (char)10;//"|BM|BetterMan|Male|";
                    //this.m_siteName   = "BetterWomanNow";
                    //this.m_googleTrackingCode = "UA-1185020-1";
                }
                m_productPrice = p.Price;
                Session["WantsMembership"] = true;
            }
        }
コード例 #17
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     this.m_page = new ITCPage();
     this.m_page.HideWest = true;
     if(!Page.IsPostBack)
         this.fillPromotionList();
 }
コード例 #18
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();
            this.m_page.HideWest = true;
            lblVoidMessage.Text = "";

            if (!Page.IsPostBack)
            {

                //this.m_startDate = cldStartDate.SelectedDate = cldStartDate.VisibleDate = System.DateTime.Now;
                //this.m_endDate = cldEndDate.SelectedDate = cldEndDate.VisibleDate = System.DateTime.Now.AddDays(1);

                //if (Request.QueryString.ToString().IndexOf("EDT") > -1)
                //    this.m_endDate = Convert.ToDateTime(Request.QueryString["EDT"]);

                //if (Request.QueryString.ToString().IndexOf("STD") > -1)
                //    this.m_startDate = Convert.ToDateTime(Request.QueryString["STD"]);

                //TODO: To be deployed for VOID functionality - MC

                if (Request.QueryString.ToString().IndexOf("EDT") > -1)
                    this.m_endDate = Convert.ToDateTime(Request.QueryString["EDT"]);

                if (Request.QueryString.ToString().IndexOf("STD") > -1)
                    this.m_startDate = Convert.ToDateTime(Request.QueryString["STD"]);

                // Mark order transaction as void
                if ((Request.QueryString.ToString().IndexOf("ISVOID") > -1) && (Request.QueryString.ToString().IndexOf("VID") > -1))
                    ProcessVoid();
            }

            //Todo: To Be Deployed for Void functionality - MC

            if (Session["StartDate"] == null)
                this.m_startDate = cldStartDate.SelectedDate = cldStartDate.VisibleDate = System.DateTime.Now;
            else
                this.m_startDate = Convert.ToDateTime(Session["StartDate"]);

            if (Session["EndDate"] == null)
            {
                this.m_endDate = cldEndDate.SelectedDate = cldEndDate.VisibleDate = System.DateTime.Now.AddDays(1);
                initSessionVariables();
            }
            else
                this.m_endDate = Convert.ToDateTime(Session["EndDate"]);
        }
コード例 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Expire the page to avoid users from clicking the back button.
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
            Response.Cache.SetNoStore();
            Response.AppendHeader("Pragma", "no-cache");

            m_currentSession = Session["SessionID"] != null ? Session["SessionID"].ToString() : "";

            if (m_currentSession == "")
                m_orderMessage = "You're order has already been processed. <br>";
            else
                m_orderMessage = "Thank you - Please wait and do not click the back button, your order is processing...";

            string siteName = Request.QueryString.ToString().IndexOf("site") > -1 ? Request.QueryString["site"] : "bm";

            if (!Page.IsPostBack)
            {
                if (m_currentSession != "")
                {
                    OTCEncryption crypt = new OTCEncryption(7);
                    int id = Convert.ToInt32(Request.QueryString["OID"]);
                    this.m_order = new OTCSalesOrder(id);
                    this.m_member = new OTCSiteMember(this.m_order.OTCSiteMemberId);
                    this.m_card = new OTCCreditCard(this.m_order.OTCSalesOrderId, Session.SessionID);

                    if (this.m_card.IISSessionId != Session.SessionID)
                    {
                        if (Request.ServerVariables["HTTP_HOST"].IndexOf("localhost") > -1)
                            Response.Redirect("/interceuticals/default.aspx");
                        else
                            Response.Redirect("http://www.interceuticals.com");
                    }

                    this.m_page = new ITCPage();
                    this.m_db.Open();
                    this.m_dt = this.m_db.GetDataset("spGetOTCSalesOrderDetails_Verisign @OTCSalesOrderId = " + id).Tables[1];

                    foreach (DataRow dr in this.m_dt.Rows)
                    {
                        this.m_product += dr["ProductName"].ToString();
                    }

                    this.m_db.ReleaseConnection();

                    //hack to finish and get deployed.
                    string sql = "SELECT * FROM OTCSalesOrderDetail WHERE OTCSalesOrderId = " + this.m_order.OTCSalesOrderId;
                    OTCDatabase db = new OTCDatabase();
                    db.Open();
                    DataTable dt = db.GetDataset(sql).Tables[0];
                    db.ReleaseConnection();

                    //this.m_siteString = "|BM|BetterMan|Male|";
                    //UTM:T|<%=Order.OTCSalesOrderId%>|<%=this.SiteName%>|<%=Order.TotalCost%>|<%=Convert.ToDouble(ProductPrice * Order.SalesTax).ToString("c").Replace("$","")%>|<%=Order.ShippingCost%>|<%=Order.City%>|<%=Order.State%>|<%=Order.Country%> UTM:I|<%=Order.OTCSalesOrderId%><%=this.SiteString%><%=ProductPrice%>|<%=ProductQty%>
                    this.m_siteName = siteName == "bm" ? "BetterManNow" : "BetterWomanNow";
                    //this.m_googleTrackingCode	= this.m_page.AnalyticsTracking;

                    foreach (DataRow dr in dt.Rows)
                    {
                        int productId = Convert.ToInt32(dr["OTCProductId"]);
                        OTCProduct p = new OTCProduct(productId);
                        if (p.CategoryId == 21)
                        {
                            this.m_siteString += "UTM:T|" + Order.OTCSalesOrderId + "|" + this.SiteName + "|" + Order.TotalCost + "|" + Convert.ToDouble(ProductPrice * Order.SalesTax).ToString("c").Replace("$", "") + "|" + Order.ShippingCost + "|" + Order.City + "|" + Order.State + "|" + Order.Country + "UTM:I|" + Order.OTCSalesOrderId + "|BM|BetterMan|Male|" + ProductPrice + "|" + ProductQty + (char)10;//"|BM|BetterMan|Male|";
                            //this.m_siteName   = "BetterManNow";
                            //this.m_googleTrackingCode = "UA-1185020-2";
                        }
                        else
                        {
                            //this.m_siteString = "|BW|BetterWoman|Female|";
                            this.m_siteString += "UTM:T|" + Order.OTCSalesOrderId + "|" + this.SiteName + "|" + Order.TotalCost + "|" + Convert.ToDouble(ProductPrice * Order.SalesTax).ToString("c").Replace("$", "") + "|" + Order.ShippingCost + "|" + Order.City + "|" + Order.State + "|" + Order.Country + "UTM:I|" + Order.OTCSalesOrderId + "|BW|BetterWoman|Female|" + ProductPrice + "|" + ProductQty + (char)10;//"|BM|BetterMan|Male|";
                            //this.m_siteName   = "BetterWomanNow";
                            //this.m_googleTrackingCode = "UA-1185020-1";
                        }
                        m_productPrice = p.Price;
                        Session["WantsMembership"] = true;

                    }

                    //Do this to avoid duplicate order post to paypal.
                    Session.Clear();
                    Session.Abandon();

                }
                else
                    Response.Redirect("PostedMessage.aspx");

            }
        }
コード例 #20
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            this.m_page = new ITCPage();

            if (m_page.IsBetterWoman)
            {
                Website = "bw";
            }
            else Website = "bm";

            string removeId = Request.QueryString.ToString().IndexOf("remove") > -1 ? Request.QueryString["remove"] : "0";
            string thread = Request.QueryString.ToString().IndexOf("thread") > -1 ? Request.QueryString["thread"] : "";
            string promotionKey = Request.QueryString.ToString().IndexOf("PRID") > -1 ? Request.QueryString["PRID"] : "";
            this.m_shoppingCartId = Request.QueryString.ToString().IndexOf("SCID") > -1 ? Convert.ToInt32(Request.QueryString["SCID"]) : 0;

            m_productID = Convert.ToInt32(Request.QueryString["PID2"]);
            m_site = Request.QueryString["site"];

            if (Convert.ToInt32(removeId) > 0)
            {
                OTCShoppingCartItem i = new OTCShoppingCartItem(Convert.ToInt32(removeId));
                OTCShoppingCart c = new OTCShoppingCart(this.m_shoppingCartId);
                c.RemoveCartItem(i);
                string newQueryString = "";
                foreach (string s in Request.QueryString.ToString().Split('&'))
                {
                    Response.Write(s + "<br>" + CR);
                    if (s != ("remove=" + removeId))
                    {
                        newQueryString += s + "&";
                    }
                }
                Response.Redirect("Checkout.aspx?" + newQueryString.Trim('&'));
            }

            if (Convert.ToInt32(Session["SID"]) > 0)
            {
                this.resetForm();
            }

            if (!Page.IsPostBack && (thread != "reset"))
            {
                this.ddState.SQL = "spGetOTCState";
                this.ddState.TextField = "StateName";
                this.ddState.IdField = "StateAbbreviation";
                this.ddState.IntroText = "Please Select";
                this.ddState.Fill();

                bindStateShipControl();

                this.ddCountry.IntroText = "Please Select";
                this.ddCountry.SQL = "spGetOTCCountry";
                this.ddCountry.TextField = "CountryName";
                this.ddCountry.IdField = "OTCCountryId";
                this.ddCountry.Fill();

                int index1 = 0;
                int index2 = 0;

                foreach (ListItem i in this.ddCountry.Items)
                {
                    switch (i.Text)
                    {
                        case "United States":
                            i.Attributes.Add("style", "color:Red");
                            break;
                        case "Canada":
                            i.Attributes.Add("style", "color:Red");
                            break;
                        case "Cameroon":
                            index1 = ddCountry.Items.IndexOf(i);
                            break;
                        case "United Arab Emirates":
                            index2 = ddCountry.Items.IndexOf(i);
                            break;
                    }
                }

                //ddCountry.Items.Insert(index1 + 1, new ListItem("Canada", "126"));
                //ddCountry.Items.Insert(index2 + 2, new ListItem("United States", "222"));

                this.ddShippingCountry.IntroText = "Please Select";
                this.ddShippingCountry.SQL = "spGetOTCCountry";
                this.ddShippingCountry.TextField = "CountryName";
                this.ddShippingCountry.IdField = "OTCCountryId";
                this.ddShippingCountry.Fill();

                index1 = 0;
                index2 = 0;

                foreach (ListItem i in this.ddShippingCountry.Items)
                {
                    switch (i.Text)
                    {
                        case "United States":
                            i.Attributes.Add("style", "color:Red");
                            break;
                        case "Canada":
                            i.Attributes.Add("style", "color:Red");
                            break;
                        case "Cameroon":
                            index1 = ddShippingCountry.Items.IndexOf(i);
                            break;
                        case "United Arab Emirates":
                            index2 = ddShippingCountry.Items.IndexOf(i);
                            break;
                    }
                }

                ddShippingCountry.Items.Insert(index1 + 1, new ListItem("Canada", "126"));
                ddShippingCountry.Items.Insert(index2 + 2, new ListItem("United States", "222"));

                this.fillCCLists();
                this.fillShippingMethods();
            }

            this.fillShippingMethods();

            this.m_salesTax = this.ddStateShip.SelectedValue == "MA" ? .0625 : 00;

            if (Request.ServerVariables["HTTP_HOST"].ToString().IndexOf("localhost") > -1)
                if (!Page.IsPostBack)
                    this.setDevelopmentForm();
        }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.m_page = new ITCPage();

            m_removeId = Request.QueryString.ToString().IndexOf("remove") > -1 ? Request.QueryString["remove"] : "0";
            thread = Request.QueryString.ToString().IndexOf("thread") > -1 ? Request.QueryString["thread"] : "";
            promotionKey = Request.QueryString.ToString().IndexOf("PRID") > -1 ? Request.QueryString["PRID"] : "";
            //this.m_shoppingCartId = Request.QueryString.ToString().IndexOf("SCID") > -1 ? Convert.ToInt32(Request.QueryString["SCID"]) : 0;
            this.m_shoppingCartId = Convert.ToInt32(Request.QueryString["SCID"]);

            m_productID = Convert.ToInt32(Request.QueryString["PID2"]);
            m_site = Request.QueryString["site"];

            initCrossSellContent();

            reloadShoppingCart();
        }