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)); } }
public ActionResult Add(long?id) { FreeRecord fr = new FreeRecord(); if (id.HasValue && id > 0) { fr = FreeRecordService.GetInfo(id.Value); if (fr == null) { fr = new FreeRecord(); } } return(View(fr)); }