Beispiel #1
0
        protected override void Render(HtmlTextWriter writer)
        {
            Hidistro.Core.Entities.SiteSettings masterSettings = Hidistro.Core.SettingsManager.GetMasterSettings(false);
            IList <ShippingModeInfo>            shippingModes  = ShoppingProcessor.GetShippingModes();

            if ((shippingModes != null) && (shippingModes.Count > 0))
            {
                StringBuilder builder = new StringBuilder();
                builder.AppendLine(" <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">请选择配送啊啊方式<span class=\"caret\"></span></button>");
                builder.AppendLine("<ul id=\"shippingTypeUl\" class=\"dropdown-menu\" role=\"menu\">");
                decimal total = 0m;//商品总额
                for (int i = 0; i < ShoppingCartItemInfo.Count; i++)
                {
                    total += ShoppingCartItemInfo[i].SubTotal;
                }
                bool isAllFreeShipping = false;
                if (masterSettings.SpecialOrderAmountType == "freeShipping")
                {
                    isAllFreeShipping = total >= masterSettings.SpecialValue1 && masterSettings.SpecialValue1 > 0M;
                }
                foreach (ShippingModeInfo info in shippingModes)
                {
                    decimal num = 0M;
                    if (this.ShoppingCartItemInfo.Count != this.ShoppingCartItemInfo.Count <Hidistro.Entities.Sales.ShoppingCartItemInfo>(a => a.IsfreeShipping))
                    {
                        num = ShoppingProcessor.CalcFreight(this.RegionId, this.Weight, info);
                        if (isAllFreeShipping)//如果达到了设置好的包邮金额,那么邮费全免
                        {
                            num = 0M;
                        }
                    }
                    string introduced5 = info.Name + ": ¥" + num.ToString("F2") + "(包邮)";
                    builder.AppendFormat("<li><a href=\"#\" name=\"{0}\" value=\"{2}\">{1}</a></li>", info.ModeId, introduced5, num.ToString("F2")).AppendLine();
                }
                builder.AppendLine("</ul>");
                writer.Write(builder.ToString());
            }
        }
Beispiel #2
0
        public int rangeId = 1;//范围id 1:pc端,0:微信端,


        protected override void AttachChildControls()
        {
            int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId);
            this.keyWord            = this.Page.Request.QueryString["keyWord"];
            this.imglogo            = (HiImage)this.FindControl("imglogo");
            this.litTitle           = (Literal)this.FindControl("litTitle");
            this.litDes             = (Literal)this.FindControl("litDes");
            this.litMemberGradeInfo = (Literal)this.FindControl("litMemberGradeInfo");
            this.imgUrl             = (HiImage)this.FindControl("imgUrl");
            this.litContent         = (Literal)this.FindControl("litContent");
            this.rptProducts        = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptCategories      = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.litCategoryId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litCategoryId");
            this.litCategoryId.SetWhenIsNotNull(this.categoryId.ToString());
            this.Page.Session["stylestatus"] = "4";

            this.storeId = !string.IsNullOrEmpty(this.Page.Request.QueryString["storeid"]) ? int.Parse(this.Page.Request.QueryString["storeid"]) : 0;

            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember == null)
            {
                this.Page.Response.Redirect("UserLogin.aspx");
            }
            HttpCookie cookie         = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
            int        ReferralUserId = 0;

            if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
            {
                ReferralUserId = Convert.ToInt32(cookie.Value);
            }

            Hidistro.Entities.Members.DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(ReferralUserId);
            Hidistro.Core.Entities.SiteSettings        masterSettings     = Hidistro.Core.SettingsManager.GetMasterSettings(false);
            //店铺logo
            if (userIdDistributors != null && !string.IsNullOrEmpty(userIdDistributors.Logo))
            {
                this.imglogo.ImageUrl = userIdDistributors.Logo;
            }
            else
            {
                if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
            }
            //店铺名和店铺描述
            if (ReferralUserId == 0)//如果没有上级店铺
            {
                this.litTitle.Text = masterSettings.SiteName;
                this.litDes.Text   = masterSettings.ShopIntroduction;
            }
            else
            {
                this.litTitle.Text = userIdDistributors.StoreName;
                this.litDes.Text   = userIdDistributors.StoreDescription;
            }

            //会员等级优惠信息
            if (this.litMemberGradeInfo != null)
            {
                MemberGradeInfo gradeInfo = MemberHelper.GetMemberGrade(currentMember.GradeId);//会员等级信息
                string          gradeName = gradeInfo.Name;
                string          currentMemberGradeName = (currentMember == null) ? "" :
                                                         string.Format("<span style='font-size:12px; background:#F90; color:#FFF; border-radius:3px; padding:3px 5px; margin-right:5px;'>{0}</span>"
                                                                       , gradeName);
                if (gradeInfo.Discount < 100)
                {
                    litMemberGradeInfo.Text = string.Format("{0}以下商品已获得{1}%折扣!", currentMemberGradeName, 100 - gradeInfo.Discount);
                }
                else
                {
                    litMemberGradeInfo.Text = string.Format("{0}以下商品均无打折", currentMemberGradeName, 100 - gradeInfo.Discount);;
                }
            }
            switch (Hidistro.Core.SettingsManager.GetMasterSettings(true).VTheme.ToLower())
            {
            case "common":
            case "hotel":
                Hidistro.Core.HiCache.Remove("DataCache-CategoriesRange");    //清除分类缓存
                //获取手机端所有商品的分类
                DataTable dt = CategoryBrowser.GetCategoriesByRange(rangeId); //CategoryBrowser.GetCategoriesRange(ProductInfo.ProductRanage.NormalSelect);

                int       total = 0;
                DataTable dt2   = new DataTable();
                if (categoryId == 0)
                {
                    if (dt.Rows.Count > 0)
                    {
                        //获取手机端商品的第一个分类id
                        int FirstCategoryID = Convert.ToInt32(dt.Rows[0]["categoryId"]);
                        this.litCategoryId.SetWhenIsNotNull(FirstCategoryID.ToString());

                        dt2 = ProductBrowser.GetProducts(MemberProcessor.GetCurrentMember(), null, 0, FirstCategoryID, this.keyWord, 1, 20, out total, "ShowSaleCounts", "desc", "", rangeId, storeId);
                    }
                }
                else
                {
                    dt2 = ProductBrowser.GetProducts(MemberProcessor.GetCurrentMember(), null, 0, categoryId, this.keyWord, 1, 20, out total, "ShowSaleCounts", "desc", "", rangeId, storeId);
                }
                //根据商品id判断是否包含其余规格,如果有,则新增一个字段存入规格号
                dt2.Columns.Add("skuCounts");
                dt2.Columns.Add("Quantity");
                List <Hidistro.Entities.Sales.ShoppingCartInfo> cart = ShoppingCartProcessor.GetShoppingCartList();   //获取购物车信息
                foreach (DataRow row in dt2.Rows)
                {
                    DataTable skus = ProductBrowser.GetSkus(Convert.ToInt32(row["ProductId"]));
                    row["skuCounts"] = skus.Rows.Count;
                    row["Quantity"]  = 0;
                    //根据商品id获取购物车中已存在的数量,防止页面刷新后选中的数量遗失
                    foreach (Hidistro.Entities.Sales.ShoppingCartInfo info in cart)
                    {
                        foreach (Hidistro.Entities.Sales.ShoppingCartItemInfo itemInfo in info.LineItems)
                        {
                            if (Convert.ToInt32(row["ProductId"]) == itemInfo.ProductId)
                            {
                                row["Quantity"] = itemInfo.Quantity;
                            }
                        }
                    }
                }
                this.rptCategories.DataSource = dt;
                this.rptCategories.DataBind();

                this.rptProducts.DataSource = dt2;
                this.rptProducts.DataBind();
                break;

            default:
                this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
                if (this.Page.Request.QueryString["TypeId"] != null)
                {
                    this.rptCategories.DataSource = CategoryBrowser.GetCategoriesByPruductType(100, Convert.ToInt32(this.Page.Request.QueryString["TypeId"]));
                    this.rptCategories.DataBind();
                }
                else
                {
                    IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategoriesRange(this.categoryId, 0x3e8, DistributorsBrower.GetCurrStoreProductRange());
                    this.rptCategories.DataSource = maxSubCategories;
                    this.rptCategories.DataBind();
                }
                PageTitle.AddSiteNameTitle("移动点餐");
                break;
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            string VisitDistributorID = Hidistro.Core.HiCache.Get(string.Format("DataCache-VisitDistributor-{0}", "333")) as string;

            if (!string.IsNullOrEmpty(VisitDistributorID))
            {
            }


            if (!string.IsNullOrEmpty(base.Request["isCallback"]) && base.Request["isCallback"] == "true")
            {
                string verifyCode = base.Request["code"];
                string str2;
                if (!this.CheckVerifyCode(verifyCode))
                {
                    str2 = "0";
                }
                else
                {
                    str2 = "1";
                }
                base.Response.Clear();
                base.Response.ContentType = "application/json";
                base.Response.Write("{ ");
                base.Response.Write(string.Format("\"flag\":\"{0}\"", str2));
                base.Response.Write("}");
                base.Response.End();
            }
            if (!this.Page.IsPostBack)
            {
                Uri urlReferrer = this.Context.Request.UrlReferrer;
                if (urlReferrer != null)
                {
                    this.ReferralLink = urlReferrer.ToString();
                }
                this.txtAdminName.Focus();
                PageTitle.AddSiteNameTitle("后台登录");

                string path = Server.MapPath("~/config/CustomConfig.xml");

                /* 阿黛尔艺丝*/

                /*DataSet dsAde = new DataSet();
                 * dsAde.DataSetName = "adele";
                 * DataTable dtAde = new DataTable();
                 * dtAde.TableName = "DistributorType";
                 * dtAde.Columns.Add("name", typeof(string));
                 * dtAde.Columns.Add("showfootmanage", typeof(string));
                 * dtAde.Columns.Add("showfootapply", typeof(string));
                 * dtAde.Columns.Add("showbutton", typeof(string));
                 * dtAde.Rows.Add(new string[] { "VIP", "VIP", "VIP", "马上成为VIP" });
                 * dsAde.Tables.Add(dtAde);
                 * dsAde.WriteXml(path, XmlWriteMode.IgnoreSchema);
                 */

                /*竞芳菲(同欣美容)*/

                /*DataSet dsJFF = new DataSet();
                 * dsJFF.DataSetName = "jingff";
                 * DataTable dtJFF = new DataTable();
                 * dtJFF.TableName = "isReturnChangeGoodsOn";
                 * dtJFF.Columns.Add("value", typeof(string));
                 * dtJFF.Rows.Add(new string[] { "true" });
                 * dsJFF.Tables.Add(dtJFF);
                 * dsJFF.WriteXml(path, XmlWriteMode.IgnoreSchema);*/

                /*齐品汇{特殊的5类分销商返佣机制}*/

                /*
                 * DataSet dsQiph = new DataSet();
                 * dsQiph.DataSetName = "Qipinhui";
                 * DataTable dtQiph = new DataTable();
                 * dtQiph.TableName = "Configs";
                 * dtQiph.Columns.Add("isQipinhui", typeof(string));
                 * dtQiph.Rows.Add(new string[] { "true" });
                 * dsQiph.Tables.Add(dtQiph);
                 * dsQiph.WriteXml(path, XmlWriteMode.IgnoreSchema);
                 * /*
                 *
                 * /*爱弗瑞{天使返利规则定制}*/
                /*DataSet dsAfr = new DataSet();
                 * dsAfr.DataSetName = "aifr";
                 * DataTable dtAFF = new DataTable();
                 * dtAFF.TableName = "Configs";
                 * dtAFF.Columns.Add("isAll", typeof(string));
                 * dtAFF.Rows.Add(new string[] { "true" });
                 * dsAfr.Tables.Add(dtAFF);
                 * dsAfr.WriteXml(path, XmlWriteMode.IgnoreSchema);
                 */

                /*迪蔓国际{文字、Logo等定制处理}*/

                /*
                 * DataSet dsDiman = new DataSet();
                 * dsDiman.DataSetName = "diman";
                 * DataTable dtDiman = new DataTable();
                 * dtDiman.TableName = "Configs";
                 * dtDiman.Columns.Add("myCashText", typeof(string));
                 * dtDiman.Columns.Add("myDistributorText", typeof(string));
                 * dtDiman.Columns.Add("showbutton", typeof(string));
                 * dtDiman.Columns.Add("isLogoOn", typeof(string));
                 * dtDiman.Columns.Add("isDistributorDescriptionOn", typeof(string));
                 * dtDiman.Columns.Add("customInputs", typeof(string));
                 * dtDiman.Rows.Add(new string[] { "我的返利", "我的分店", "马上注册微店", "false", "false", "<div class=\"login-name\"> <span class=\"glyphicon glyphicon-phone\"></span><input type=\"text\" class=\"\" id=\"username\" placeholder=\"请输入手机号\"/>  </div> <div class=\"login-name\"><span class=\"glyphicon glyphicon-user\"></span><input type=\"password\" class=\"\" id=\"pass\" placeholder=\"请输入真实姓名\"/>  </div><script>$(function () {$(\".btn-apply\").click(function () {if ($(\"#username\").val() == \"\" || $(\"#pass\").val() == \"\") {alert_h(\"请将信息填写完整!\");return false; } });}); </script>" });
                 * dsDiman.Tables.Add(dtDiman);
                 * dsDiman.WriteXml(path, XmlWriteMode.IgnoreSchema);
                 */

                /*玖信健佳{后台代理商的分区域相关功能}*/

                /*
                 * DataSet dsJXJJ = new DataSet();
                 * dsJXJJ.DataSetName = "JXJJ";
                 * DataTable dtJXJJ = new DataTable();
                 * dtJXJJ.TableName = "Configs";
                 * dtJXJJ.Columns.Add("regionalFunction", typeof(bool));
                 * dtJXJJ.Rows.Add(new string[] { "true" });
                 * dsJXJJ.Tables.Add(dtJXJJ);
                 * dsJXJJ.WriteXml(path, XmlWriteMode.IgnoreSchema);
                 */

                /*默认配置*/

                /*
                 * DataSet dsDefault = new DataSet();
                 * dsDefault.DataSetName = "default";
                 * DataTable dtDefault = new DataTable();
                 * dtDefault.TableName = "Configs";
                 * dtDefault.Columns.Add("isQuickGetCashOn", typeof(bool));
                 * dtDefault.Rows.Add(new string[] { "true" });
                 * dsDefault.Tables.Add(dtDefault);
                 * dsDefault.WriteXml(path, XmlWriteMode.IgnoreSchema);
                 */
                Hidistro.Core.Entities.SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                //对特殊用户的特殊功能进行相应的隐藏显示
                if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.RegionalFunction)
                {
                    this.specialHideShow.Value = "jxjj";//玖信健佳
                }
            }
        }