Пример #1
0
 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);
 }
Пример #2
0
 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);
 }
Пример #3
0
 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);
 }
Пример #4
0
        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();
        }
Пример #5
0
 /// <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);
     }
 }
Пример #6
0
 /// <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);
 }
Пример #7
0
 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();
 }
Пример #8
0
        /// <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;
        }
Пример #9
0
        /// <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;
        }
Пример #10
0
        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();
        }
Пример #11
0
        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);
        }