Esempio n. 1
0
    //小计
    public string GetPrice()
    {
        //string field = "LinPrice";
        int    pronum = Convert.ToInt32(Eval("Pronum"));
        double price  = proBll.P_GetByUserType(proBll.GetproductByid(Convert.ToInt32(Eval("ProID"))), buser.GetLogin());
        double total  = price * pronum;

        return(total.ToString("0.00"));
    }
Esempio n. 2
0
    //小计
    public string GetPrice()
    {
        M_Product proMod = proBll.GetproductByid(Convert.ToInt32(Eval("ProID")));
        //string field = "LinPrice";
        int    pronum = Convert.ToInt32(Eval("Pronum"));
        double price  = proBll.P_GetByUserType(proBll.GetproductByid(Convert.ToInt32(Eval("ProID"))), buser.GetLogin());

        if (price <= 0)
        {
            M_LinPrice priceMod = JsonConvert.DeserializeObject <M_LinPrice>(proMod.LinPrice_Json);
            price = priceMod.Point;
        }
        double total = price * pronum;

        return(total.ToString("0.00"));
    }
Esempio n. 3
0
        //更新购物车中的AllMoney(实际购买总价),便于后期查看详情
        private double UpdateCartAllMoney(DataTable dt)
        {
            M_UserInfo mu       = buser.GetLogin();
            double     allmoney = 0;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow   dr      = dt.Rows[i];
                M_Cart    cartMod = cartBll.GetCartByid(Convert.ToInt32(dr["ID"]));
                M_Product proMod  = proBll.GetproductByid(Convert.ToInt32(dr["Proid"]));
                //--附加币值计价
                //if (orderCom.HasPrice(proMod.LinPrice_Json))
                //{
                //    M_LinPrice priceMod = JsonConvert.DeserializeObject<M_LinPrice>(proMod.LinPrice_Json);
                //    priceMod.Purse = priceMod.Purse * cartMod.Pronum;
                //    priceMod.Sicon = priceMod.Sicon * cartMod.Pronum;
                //    priceMod.Point = priceMod.Point * cartMod.Pronum;
                //    dr["AllMoney_Json"] = JsonConvert.SerializeObject(priceMod);
                //    cartMod.AllMoney_Json = DataConvert.CStr(dr["AllMoney_Json"]);
                //}
                //根据商品价格类型,看使用  零售|批发|会员|会员组价格
                //多区域价格
                if (string.IsNullOrEmpty(Region))
                {
                    Region = buser.GetRegion(mu.UserID);
                }
                double price = regionBll.GetRegionPrice(proMod.ID, proMod.LinPrice, Region, mu.GroupID);
                //如果多区域价格未匹配,则匹配会员价
                if (price == proMod.LinPrice)
                {
                    price = proBll.P_GetByUserType(proMod, mu);
                }
                //--多价格编号,则使用多价格编号的价钱,ProName(已在购物车页面更新)
                //double price =proBll.GetPriceByCode(dr["code"], proMod.Wholesalesinfo, ref price);
                cartMod.AllMoney    = price * cartMod.Pronum;
                cartMod.AllIntegral = cartMod.AllMoney;
                //----计算折扣
                dr["AllMoney"]    = cartMod.AllMoney;
                dr["AllIntegral"] = cartMod.AllIntegral;
                if (proMod.Recommend > 0)
                {
                    dr["AllMoney"]   = (cartMod.AllIntegral - (cartMod.AllIntegral * ((double)proMod.Recommend / 100)));
                    cartMod.AllMoney = Convert.ToDouble(dr["AllMoney"]);
                }
                cartBll.UpdateByID(cartMod);
                allmoney += cartMod.AllMoney;
            }
            return(allmoney);
        }
Esempio n. 4
0
        //更新购物车中的AllMoney(实际购买总价),便于后期查看详情
        private double UpdateCartAllMoney(DataTable dt)
        {
            M_UserInfo mu       = buser.GetLogin();
            double     allmoney = 0;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow   dr      = dt.Rows[i];
                M_Cart    cartMod = new M_Cart().GetModelFromReader(dr);
                M_Product proMod  = proBll.GetproductByid(Convert.ToInt32(dr["Proid"]));
                //根据商品价格类型,看使用  零售|批发|会员|会员组价格
                //多区域价格
                //if (string.IsNullOrEmpty(Region))
                //{
                //    Region = buser.GetRegion(mu.UserID);
                //}
                //double price = regionBll.GetRegionPrice(proMod.ID, proMod.LinPrice, Region, mu.GroupID);
                ////如果多区域价格未匹配,则匹配会员价
                //if (price == proMod.LinPrice) { price = proBll.P_GetByUserType(proMod, mu); }
                double price = proBll.P_GetByUserType(proMod, mu);
                //--多价格编号,则使用多价格编号的价钱,ProName(已在购物车页面更新)
                //double price =proBll.GetPriceByCode(dr["code"], proMod.Wholesalesinfo, ref price);
                cartMod.AllMoney_Init = cartMod.AllMoney = price * cartMod.Pronum;
                cartMod.FarePrice     = price.ToString("F2");
                cartMod.Shijia        = price;
                //----检查有无价格方面的促销活动,如果有,检免多少金额
                {
                    W_Filter filter = new W_Filter();
                    filter.cartMod    = cartMod;
                    filter.TypeFilter = "money";
                    ptBll.WhereLogical(filter);
                    cartMod.AllMoney_Arrive += filter.DiscountMoney;
                    cartMod.ArriveRemark    += "促销:" + filter.DiscountMoney.ToString("F2");
                }
                //----计算折扣
                cartMod.AllMoney = cartMod.AllMoney_Init - cartMod.AllMoney_Arrive;
                if (cartMod.AllMoney < 0)
                {
                    cartMod.AllMoney = 0;
                }
                //------------------------------
                dr["AllMoney"] = cartMod.AllMoney;
                cartBll.UpdateByID(cartMod);
                allmoney += cartMod.AllMoney;
            }
            //缓存数据,提交时验证
            VerifyDT = CartDT.DefaultView.ToTable(false, verifyFields);
            return(allmoney);
        }
Esempio n. 5
0
        //单价
        public string GetMyPrice()
        {
            int        proID    = Convert.ToInt32(Eval("ProID"));
            double     linPrice = TempPrice = Convert.ToDouble(Eval("LinPrice"));
            M_UserInfo mu       = buser.GetLogin();
            M_Product  proMod   = proBll.GetproductByid(proID);

            //如果多区域价格未匹配,则匹配会员价
            if (TempPrice == linPrice || TempPrice <= 0)
            {
                TempPrice = proBll.P_GetByUserType(proMod, mu);
            }
            string html = "<i class='zi zi_yensign'></i><span id='price_" + Eval("ID") + "'>" + TempPrice.ToString("f2") + "</span>";

            return(html);
        }
Esempio n. 6
0
        //单价
        public string GetMyPrice()
        {
            int        proID    = Convert.ToInt32(Eval("ProID"));
            double     linPrice = Convert.ToDouble(Eval("LinPrice"));
            M_UserInfo mu       = buser.GetLogin();
            M_Product  proMod   = proBll.GetproductByid(proID);

            //多区域价格
            if (string.IsNullOrEmpty(Region))
            {
                Region = buser.GetRegion(mu.UserID);
            }
            TempPrice = regionBll.GetRegionPrice(proID, linPrice, Region, mu.GroupID);
            //如果多区域价格未匹配,则匹配会员价
            if (TempPrice == linPrice)
            {
                TempPrice = proBll.P_GetByUserType(proMod, mu);
            }

            string html = "<i class='fa fa-rmb'></i><span id='price_" + Eval("ID") + "'>" + TempPrice.ToString("f2") + "</span>";

            //if (orderCom.HasPrice(Eval("LinPrice_Json")))
            //{
            //    string json = DataConvert.CStr(Eval("LinPrice_Json"));
            //    M_LinPrice priceMod = JsonConvert.DeserializeObject<M_LinPrice>(json);
            //    if (priceMod.Purse > 0)
            //    {
            //        html += "余额:<span id='price_purse_" + Eval("ID") + "'>" + priceMod.Purse.ToString("f2") + "</span>";
            //    }
            //    if (priceMod.Sicon > 0)
            //    {
            //        html += "|银币:<span id='price_sicon_" + Eval("ID") + "'>" + priceMod.Sicon.ToString("f0") + "</span>";
            //    }
            //    if (priceMod.Point > 0)
            //    {
            //        html += "|积分:<span id='price_point_" + Eval("ID") + "'>" + priceMod.Point.ToString("f0") + "</span>";
            //    }
            //}
            return(html);
        }
Esempio n. 7
0
        //单价
        public string GetMyPrice()
        {
            int        proID    = Convert.ToInt32(Eval("ProID"));
            double     linPrice = TempPrice = Convert.ToDouble(Eval("LinPrice"));
            M_UserInfo mu       = buser.GetLogin();
            M_Product  proMod   = proBll.GetproductByid(proID);

            //多区域价格
            //if (string.IsNullOrEmpty(Region))
            //{
            //    Region = buser.GetRegion(mu.UserID);
            //}
            //TempPrice = regionBll.GetRegionPrice(proID, linPrice, Region, mu.GroupID);
            //如果多区域价格未匹配,则匹配会员价
            if (TempPrice == linPrice || TempPrice <= 0)
            {
                TempPrice = proBll.P_GetByUserType(proMod, mu);
            }
            string html = "<i class='fa fa-rmb'></i><span id='price_" + Eval("ID") + "'>" + TempPrice.ToString("f2") + "</span>";

            return(html);
        }
Esempio n. 8
0
        //单价
        public IHtmlContent GetMyPrice(DataRow dr)
        {
            int       proID    = Convert.ToInt32(dr["ProID"]);
            double    linPrice = TempPrice = Convert.ToDouble(dr["LinPrice"]);
            M_Product proMod   = proBll.GetproductByid(proID);

            //多区域价格
            //if (string.IsNullOrEmpty(Region))
            //{
            //    Region = buser.GetRegion(mu.UserID);
            //}
            //TempPrice = regionBll.GetRegionPrice(proID, linPrice, Region, mu.GroupID);
            //如果多区域价格未匹配,则匹配会员价
            if (TempPrice == linPrice || TempPrice <= 0)
            {
                TempPrice = proBll.P_GetByUserType(proMod, mu);
            }
            string html = "<i class='zi zi_yensign'></i><span id='price_" + dr["ID"] + "'>" + TempPrice.ToString("f2") + "</span>";

            //if (orderCom.HasPrice(Eval("LinPrice_Json")))
            //{
            //    string json = DataConvert.CStr(Eval("LinPrice_Json"));
            //    M_LinPrice priceMod = JsonConvert.DeserializeObject<M_LinPrice>(json);
            //    if (priceMod.Purse > 0)
            //    {
            //        html += "余额:<span id='price_purse_" + Eval("ID") + "'>" + priceMod.Purse.ToString("f2") + "</span>";
            //    }
            //    if (priceMod.Sicon > 0)
            //    {
            //        html += "|银币:<span id='price_sicon_" + Eval("ID") + "'>" + priceMod.Sicon.ToString("f0") + "</span>";
            //    }
            //    if (priceMod.Point > 0)
            //    {
            //        html += "|积分:<span id='price_point_" + Eval("ID") + "'>" + priceMod.Point.ToString("f0") + "</span>";
            //    }
            //}
            return(MvcHtmlString.Create(html));
        }