示例#1
0
        //会员ID,商品id
        public static double DiscountedPrice(int memberid, double price, string discountprice)
        {
            double reprice = price;
            try
            {
                ShowShop.BLL.Member.MemberAccount memberbll = new ShowShop.BLL.Member.MemberAccount();
                ShowShop.Model.Member.MemberAccount membermodel = memberbll.GetModel(memberid);
                if (membermodel != null)
                {
                    int level = int.Parse(membermodel.UserGroup.ToString());
                    ShowShop.BLL.Member.MemberRank rankbll = new ShowShop.BLL.Member.MemberRank();
                    ShowShop.Model.Member.MemberRank rankmodel = rankbll.GetModel(level);
                    double Discount = 1;
                    if (rankmodel != null)
                    {
                        Discount = Convert.ToDouble(rankmodel.Discount.ToString());
                    }
                    string[] StrDiscountPrice = discountprice.Split('|');
                    if (StrDiscountPrice.Length > 0)
                    {
                        for (int i = 0; i < StrDiscountPrice.Length - 1; i++)
                        {
                            string[] DiscountPrice = StrDiscountPrice[i].Split(',');
                            string num = DiscountPrice[0].ToString();
                            if (Convert.ToInt32(num) == level)
                            {
                                reprice = Convert.ToDouble(DiscountPrice[0].ToString());
                                break;
                            }
                            else
                            {
                                if (rankmodel != null)
                                {
                                    reprice = price * Discount / 100;
                                }

                            }
                        }
                    }
                    else
                    {
                        reprice = price * Discount / 100;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return reprice;
        }
 protected string GetGroupName(int groupId)
 {
     ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
     ShowShop.Model.Member.MemberRank model = bll.GetModel(groupId);
     if (model != null)
     {
         return model.Name;
     }
     else
     {
         return "无该用户组";
     }
 }
        private void GetModel()
        {
            int id = ChangeHope.WebPage.PageRequest.GetQueryInt("id");
            if(id>0)
            {
                ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
                Model.Member.MemberRank model = bll.GetModel(id);
                this.txtDiscount.Text = model.Discount.ToString();
                this.txtId.Value = model.Id.ToString();
                this.txtLogoPicImg.ImageUrl ="/"+ model.LogoPic;
                this.txtLogoPicUrl.Value = model.LogoPic;
                this.txtMaxMoney.Text = model.MaxMoney.ToString();
                this.txtMaxScore.Text = model.MaxScore.ToString();
                this.txtMinScore.Text = model.MinScore.ToString();
                this.txtName.Text = model.Name;
                this.txtPriority.Text = model.Priority.ToString();
                this.txtUpgradeMoney.Text = model.UpgradeMoney.ToString();
                this.ckbIsUpgrade.SelectedValue = model.IsUpgrade.ToString();

                foreach (ListItem it in this.ckbOtherInfo.Items)
                {
                    if (it.Value.Equals("IsShowPrice") && model.IsShowPrice.Equals(1))
                    {
                        it.Selected = true;
                    }
                    if (it.Value.Equals("IsSpecial") && model.IsSpecial.Equals(1))
                    {
                        it.Selected = true;
                    }
                    if (it.Value.Equals("Article") && model.Article.Equals(1))
                    {
                        it.Selected = true;
                    }
                    if (it.Value.Equals("Product") && model.Product.Equals(1))
                    {
                        it.Selected = true;
                    }
                    if (it.Value.Equals("ArticleAuditing") && model.ArticleAuditing.Equals(1))
                    {
                        it.Selected = true;
                    }
                    if (it.Value.Equals("ProductAuditing") && model.ProductAuditing.Equals(1))
                    {
                        it.Selected = true;
                    }
                }

                bll = null;
                model = null;
            }
        }