public ActionResult CardDetail() { string cardName=Request.QueryString["cardName"].ToString(); bizCard bc = new bizCard(); Card model = bc.Get(cardName); UserXCard modelUserCard = (new bizUserXCard()).Get(UserID, cardName); ViewData["User"] = (new bizUsers()).Get(UserID); ViewData["CardFusion"] = (new bizCardFusion()).List(cardName); ViewData["Num"] = modelUserCard == null ? 0 : modelUserCard.CardNum; ViewData["CardName"] = cardName; return View(model); }
public ActionResult BuyCard(FormCollection f) { bizUsers bu = new bizUsers(); bizCard bc = new bizCard(); bizUserXCard buc = new bizUserXCard(); Card cmodel = bc.Get(f["cardName"]); Users umodel = bu.Get(UserID); if (cmodel.AllowBuy != 1) return Content("�õ���������"); if (umodel.Jinbi < int.Parse(f["cardNum"]) * cmodel.Price) return Content("��İɱҲ�����������"); buc.BuyCard(UserID, f["cardName"], int.Parse(f["cardNum"])); return Content("�ɹ�������" + f["cardNum"] + "��"+cmodel.CardAlias); }
public ActionResult CardList() { string typeid = Request.QueryString["typeid"] == null ? "" : Request.QueryString["typeid"].ToString(); bizCard bc = new bizCard(); bizCardType bct = new bizCardType(); List<CardType> listType = bct.List(); List<Card> list; if (typeid == "") list = bc.List(); else list = bc.ListByTypeID(int.Parse(typeid)); ViewData["User"] = (new bizUsers()).Get(UserID); ViewData["TypeList"] = listType; ViewData["TypeID"] = typeid; return View(list); }
public ActionResult CardFusion() { string cardName = Request["cardname"]; if (string.IsNullOrEmpty(cardName)) { return RedirectToAction("UserHeList"); } bizCardFusion biz = new bizCardFusion(); List<CardFusion> list = biz.List(cardName); ViewData["CardList"] = list; bizCard bc = new bizCard(); ViewData["CardAlias"] = bc.GetByName(bc.List(),cardName).CardAlias; ViewData["FusionList"] = biz.GetCardFusion(cardName, UserID); ViewData["CardName"] = cardName; return View(); }
/// <summary> /// 新增Card /// </summary> /// <param name="userID"></param> /// <param name="cardName"></param> /// <param name="cardNum"></param> public void AddCard(int userID,string cardName, int cardNum) { UserXCard modelOld = Get(userID, cardName); bizCard bc = new bizCard(); Card modelCard = bc.Get(cardName); if (modelOld == null) { UserXCard model = new UserXCard(); model.UserID = userID; model.CardName = cardName; model.CardNum = cardNum; Add(model); } else { modelOld.Attach(); modelOld.CardNum += cardNum; modelOld.Detach(); Update(modelOld); } }
/// <summary> /// 新增Card /// </summary> /// <param name="userID"></param> /// <param name="cardName"></param> /// <param name="cardNum"></param> public void AddCard(int userID,string userName,string adminName, string cardName, int cardNum) { UserXCard modelOld = Get(userID, cardName); bizCard bc=new bizCard(); Card modelCard=bc.Get(cardName); if (modelOld == null) { UserXCard model = new UserXCard(); model.UserID = userID; model.CardName = cardName; model.CardNum = cardNum; Add(model); } else { modelOld.Attach(); modelOld.CardNum += cardNum; modelOld.Detach(); Update(modelOld); } (new bizAdminLog()).Add("为" + userName + "加上道具" + modelCard.CardAlias + cardNum.ToString() + "张", userName, adminName); string msg = "管理员 [b]" + adminName + "[/b] 为您加上道具[color=red]" + modelCard.CardAlias + cardNum.ToString() + "张[/color],并祝您在论坛中玩得开心。"; (new bizUserMsg()).AddSysMsg(userID, msg); }
public ActionResult UserCard() { bizUserXCard buc = new bizUserXCard(); bizCard bc = new bizCard(); List<Card> listCard = bc.List(); List<UserCardDetail> list = buc.ListDetailByUser(UserID); ViewData["CardList"] = list; return View(); }
/// <summary> /// �õ�����Ŀ�Ƭ���ܼ۸� /// </summary> /// <param name="f"></param> /// <returns></returns> public int GetCardPrice(FormCollection f) { bizCard b = new bizCard(); List<Card> list = b.List(); int price = 0; int cardPrice = 0; for (int i = 0; i < f.Count; i++) { if (int.Parse(f[i]) > 0) { foreach (Card card in list) { if (card.CardName == f.AllKeys[i].Trim()) { cardPrice = card.Price; } } price += cardPrice * int.Parse(f[i]); } } return price; }
/// <summary> /// 所有的道具列表 /// </summary> /// <returns></returns> public List<Card> ListCard() { string SysName = CacheName.ListCard.ToString(); List<Card> list = null; if (SysCache.Contains(SysName)) { list = SysCache.Get(SysName) as List<Card>; } if (list != null) return list; bizCard bt = new bizCard(); list = bt.List(); //SysCache.Add(SysName, list, new AbsoluteTime(DateTime.Now.AddHours(1))); return list; }
public ActionResult UserJiJiedu() { bizCard c = new bizCard(); bizUserXCard uc = new bizUserXCard(); List<Card> listCard = BBSCache.Instance().ListCard(); bizUserXCard buc = new bizUserXCard(); List<UserXCard> list = buc.ListByUser(UserID); ViewData["CardList"] = listCard; ViewData["UserCard"] = list; return View(); }
public ActionResult UseCard(int id) { bizBBSMain bm = new bizBBSMain(); bizCard c = new bizCard(); bizUserXCard uc = new bizUserXCard(); BBSMain model = bm.Get(id); List<Card> listCard = BBSCache.Instance().ListCard(); bizUserXCard buc = new bizUserXCard(); List<UserXCard> list = buc.ListByUser(UserID); ViewData["CardList"] = listCard; ViewData["UserCard"] = list; ViewData["bbsMainID"] = id; return View(model); }