Exemplo n.º 1
0
        public ActionResult GetFreeDetail(long userid, int freeid)
        {
            var product      = FreeProductService.GetInfo(freeid);
            var frecordToday = FreeRecordService.GetTodayRecord(userid);
            var frecord      = FreeRecordService.GetInfo(userid, freeid);

            if (product != null)
            {
                var obj = new
                {
                    id         = product.ID,
                    name       = product.Name,
                    imgs       = product.ImgUrls.Split('|'),
                    desc       = product.Desc,
                    count      = product.Count,
                    remain     = product.RQty,
                    isget      = frecord != null,
                    isgetother = frecordToday != null,
                    status     = product.Status,
                    time       = product.AddedTime.Value.ToString("MM/dd 23:59")
                };
                return(Json(new { code = 0, data = obj }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { code = 1, msg = "赠品不存在" }, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public ActionResult Add(int?id)
        {
            FreeProduct p = new FreeProduct();

            if (id.HasValue && id > 0)
            {
                p = FreeProductService.GetInfo(id.Value);
                if (p == null)
                {
                    p = new FreeProduct();
                }
            }

            return(View(p));
        }