Example #1
0
 public void GetItem()
 {
     ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
     List<ShowShop.Model.Member.MemberRank> model = bll.GetAllMemberRank();
     cbxlMemberRank.DataSource = model;
     cbxlMemberRank.DataTextField = "Name";
     cbxlMemberRank.DataValueField = "Id";
     cbxlMemberRank.DataBind();
 }
        private void GetMemberRank()
        {
            ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
            System.Data.DataTable tb = bll.GetList();

            foreach (System.Data.DataRow row in tb.Rows)
            {
                this.ckbPower.Items.Add(new ListItem(row["Name"].ToString(), row["Id"].ToString()));
            }
            tb.Dispose();
            tb = null;
        }
Example #3
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 "无该用户组";
     }
 }
 public void BindType()
 {
     ShowShop.BLL.Member.MemberRank rankBll=new ShowShop.BLL.Member.MemberRank();
        List<ShowShop.Model.Member.MemberRank> ranks = rankBll.GetAllMemberRank();
        if(ranks!=null&&ranks.Count>0)
        {
        this.w_l_payment_putouttypeid.DataSource = ranks;
        this.w_l_payment_putouttypeid.DataTextField = "Name";
        this.w_l_payment_putouttypeid.DataValueField = "Id";
        this.w_l_payment_putouttypeid.DataBind();
        this.w_l_payment_putouttypeid.Items.Insert(0, new ListItem("选择", ""));
        }
 }
        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;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if(!this.Page.IsPostBack)
     {
         ShowShop.Common.PromptInfo.Popedom("008003001");
         ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
         int id = ChangeHope.WebPage.PageRequest.GetQueryInt("id");
         if(id>0)
         {
             ShowShop.Common.PromptInfo.Popedom("008003003","对不起,您没有权限进行删除");
             bll.Delete(id);
         }
         this.lblList.Text = bll.GetView();
         bll = null;
     }
 }
 protected void GetMemberRankList(string ShopPrice, string MemberPrice)
 {
     if (ShopPrice == "")
     {
         ShopPrice = "0.00";
     }
     string[] strMemberPrice = MemberPrice.Split('|');
     ShowShop.Common.SysParameter sp = new ShowShop.Common.SysParameter();
     ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
     ShowShop.BLL.Member.MemberRank data = new ShowShop.BLL.Member.MemberRank();
     List<ShowShop.Model.Member.MemberRank> list = data.GetAllMemberRank();
     //第一步先添加表头
     table.AddHeadCol("30%", "会员等级");
     table.AddHeadCol("40%", "价格");
     table.AddHeadCol("30%", "默认");
     table.AddRow();
     //添加表的内容
     if (list.Count > 0)
     {
         int col = 0;
         foreach (ShowShop.Model.Member.MemberRank va in list)
         {
             col++;
             table.AddCol("<input type='hidden' id='rankId" + col + "' name ='rankId" + col + "' value='" + va.Id + "'/>" + va.Name);
             if(MemberPrice!=""&&MemberPrice!=string.Empty)
             {
             foreach (string mp in strMemberPrice)
             {
                 string[] memberPr = mp.Split(',');
                 if (memberPr[0].ToString()==va.Id.ToString())
                 {
                     table.AddCol("<input type='text' name='rankName" + col + "' id='rankName" + col + "' value='" + memberPr [1]+ "'/>");
                 }
             }
             }
             else
             {
                 table.AddCol("<input type='text' name='rankName" + col + "' id='rankName" + col + "'/>");
             }
             table.AddCol(((Convert.ToDouble(ShopPrice) * Convert.ToDouble(va.Discount)) / 100).ToString("f2"));
             table.AddRow();
         }
         this.hfMemberPrice.Value = col.ToString();
     }
     string view = table.GetTable();
     this.Literal1.Text = view;
 }
Example #9
0
 protected void MemberRankBind()
 {
     ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
     List<ShowShop.Model.Member.MemberRank> model = bll.GetAllMemberRank();
     lbxFrom.DataSource = model;
     lbxFrom.DataTextField = "Name";
     lbxFrom.DataValueField = "Id";
     lbxFrom.DataBind();
     lbxTo.DataSource = model;
     lbxTo.DataTextField = "Name";
     lbxTo.DataValueField = "Id";
     lbxTo.DataBind();
 }
 private void Sava()
 {
     if (UploadFile())
     {
         ShowShop.BLL.Member.MemberRank bll = new ShowShop.BLL.Member.MemberRank();
         Model.Member.MemberRank model = new ShowShop.Model.Member.MemberRank();
         //model.Discount=(decimal)ChangeHope.Common.StringHelper.String2Double(this.txtDiscount.Text);
         model.Discount = Convert.ToDecimal(this.txtDiscount.Text);
         model.Id = ChangeHope.Common.StringHelper.StringToInt(this.txtId.Value);
         model.LogoPic = this.txtLogoPicUrl.Value;
         model.MaxMoney = (decimal)ChangeHope.Common.StringHelper.String2Double(this.txtMaxMoney.Text);
         model.MaxScore = (decimal)ChangeHope.Common.StringHelper.String2Double(this.txtMaxScore.Text);
         model.MinScore = (decimal)ChangeHope.Common.StringHelper.String2Double(this.txtMinScore.Text);
         model.Name = this.txtName.Text;
         model.Priority = ChangeHope.Common.StringHelper.StringToInt(this.txtPriority.Text);
         model.UpgradeMoney = (decimal)ChangeHope.Common.StringHelper.String2Double(this.txtUpgradeMoney.Text);
         model.IsUpgrade = ChangeHope.Common.StringHelper.StringToInt(this.ckbIsUpgrade.SelectedValue);
         model.IsShowPrice = 0;
         model.IsSpecial = 0;
         model.Product = 0;
         model.ProductAuditing = 0;
         model.Article = 0;
         model.ArticleAuditing = 0;
         foreach (ListItem it in this.ckbOtherInfo.Items)
         {
             if (it.Selected)
             {
                 if (it.Value.Equals("IsShowPrice"))
                 {
                     model.IsShowPrice = 1;
                 }
                 if (it.Value.Equals("IsSpecial"))
                 {
                     model.IsSpecial = 1;
                 }
                 if (it.Value.Equals("Article"))
                 {
                     model.Article = 1;
                 }
                 if (it.Value.Equals("Product"))
                 {
                     model.Product = 1;
                 }
                 if (it.Value.Equals("ArticleAuditing"))
                 {
                     model.ArticleAuditing = 1;
                 }
                 if (it.Value.Equals("ProductAuditing"))
                 {
                     model.ProductAuditing = 1;
                 }
             }
         }
         if (model.Id > 0)
         {
             bll.Update(model);
             this.ltlMsg.Text = "操作成功,已保存该信息";
             this.pnlMsg.Visible = true;
             this.pnlMsg.CssClass = "actionOk";
         }
         else
         {
             bll.Add(model);
             this.txtName.Text = string.Empty;
             this.ltlMsg.Text = "操作成功,已保存该信息";
             this.pnlMsg.Visible = true;
             this.pnlMsg.CssClass = "actionOk";
         }
         model = null;
         bll = null;
     }
 }