/// <summary> /// 礼品详情 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult GiftDetails(int id) { var gift = GiftBll.LoadEntities(g => g.Id == id).FirstOrDefault(); ViewData.Model = gift as Gift; return(View()); }
public frmMain() { _giftbll = new GiftBll(); _userbll = new UserBll(); _giftUserbll = new GiftUserBll(); InitializeComponent(); System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;//设置该属性 为false }
public ActionResult AmoyWelFare() { List <GameDemoViewModel> list = GameDemoBll.GetRecForumDemo(); ViewData["GameDemo"] = list; List <Gift> giftlist = GiftBll.NewestPublishGift(); ViewBag.NewestGift = giftlist; return(View()); }
public ActionResult GiftList() { int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); int pageSize = int.Parse(Request["pageSize"] ?? "8"); int totalCount = 0; ViewBag.AllGift = GiftBll.LoadPageEntities(pageSize, pageIndex, out totalCount, g => true, false, g => g.Intime).ToList(); ViewData["pageSize"] = pageSize; ViewData["pageIndex"] = pageIndex; ViewData["totalCount"] = totalCount; return(View()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int productId; if (!int.TryParse(Request.QueryString["productId"], out productId)) { productId = 0; } GiftBll gbll = new GiftBll(); model = gbll.GetModel(productId); if (model == null) { throw new ShopException("你查找的积分商品不存在", true); } } }
public ActionResult ConfirmGiftOrder() { string guid = Request["userId"]; //从分布式缓存拿出来的对象不能进行延迟加载。 var user = Common.CacheHelper.Get(guid) as PersonalUser; int giftId = int.Parse(Request["giftId"]); string currentColor = Request["color"]; int num = int.Parse(Request["num"]); var gift = GiftBll.LoadEntities(g => g.Id == giftId).FirstOrDefault(); ViewData.Model = gift as Gift; //总价格 ViewBag.TotalPrice = (float)gift.Price * num; //索要的数量 ViewBag.Num = num; ViewBag.Color = currentColor; return(View()); }
public frmMain() { InitializeComponent(); _giftbll = new GiftBll(); }
public ActionResult ExChangeGift(int userId, int giftId, int addressId, int num, string color) { var data = GiftBll.ExChangeGift(userId, giftId, addressId, num, color); return(Json(data, JsonRequestBehavior.AllowGet)); }