public async Task <ActionResult> Add(long goodsId, long memberId)
        {
            DataTable dt = await _specAppService.GetObjTableBuyObjId(goodsId);

            if (dt.Rows.Count == 0 || dt == null)//商品如果没有规格
            {
                DataRow dr    = dt.NewRow();
                var     goods = await _AppService.GetByIdAsync(goodsId);

                dr["Id"]    = goodsId;
                dr["Text"]  = "--";
                dr["Stock"] = goods.Stock;
                dr["Price"] = goods.Price;
                dt.Rows.Add(dr);
            }


            ViewBag.Member = await _memAppService.GetEntity(memberId);

            decimal pp = Convert.ToDecimal(await _parService.GetParameterValue("PointPayPrice"));

            ViewBag.MaxIntegralToMoney = ((decimal)(ViewBag.Member.Integral / pp)).ToString("#0.00");

            ViewBag.PayType = await _parService.GetParameterValue("PayType");

            ViewBag.Coupon = _copAppService.GetUseableCoupon(memberId, (decimal)dt.Rows[0]["Price"]);
            return(View("_Select", dt));
        }
Exemple #2
0
        public async Task <IActionResult> Index(long?id)
        {
            //   ViewBag.Page = new PagedList<DataRow>(null, 1, 1);
            if (id != null)
            {
                ViewBag.CarId = (await _AppService.GetEntity((long)id)).CardID;
            }

            var levelDropDown = (await _levelAppService.GetDropDown());

            ViewData.Add("Level", new SelectList(levelDropDown, "Id", "Title"));

            var storeDropDown = (await _storeAppService.GetDropDown());

            ViewData.Add("ChainStore", new SelectList(storeDropDown, "Id", "Name"));

            string where = _comAppService.GetWhere();
            int     total;
            string  sql = $@"select c.id,c.Title from dbo.TCoupon c where c.id>0";
            DataSet ds  = _couponService.GetPage(1, int.MaxValue, "id desc", out total, where, sql);

            ViewBag.CouponTable = ds.Tables[0];
            return(View());
        }