コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BankerType bankerType = db.BankerType.Find(id);

            db.BankerType.Remove(bankerType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,Name")] BankerType bankerType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bankerType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bankerType));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "ID,Name")] BankerType bankerType)
        {
            if (ModelState.IsValid)
            {
                db.BankerType.Add(bankerType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(bankerType));
        }
コード例 #4
0
        // GET: BankerTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BankerType bankerType = db.BankerType.Find(id);

            if (bankerType == null)
            {
                return(HttpNotFound());
            }
            return(View(bankerType));
        }
コード例 #5
0
ファイル: BankerCtrl.cs プロジェクト: narakai/chessgame
        /// <summary>
        /// 设置庄状态
        /// </summary>
        /// <param name="bt"></param>
        public void SetBankerType(BankerType bt)
        {
            CurBankerType = bt;
            switch (CurBankerType)
            {
            case BankerType.StayedBanker:
                SetApplyBankerBtnActive(false);
                break;

            case BankerType.CanBecomeBanker:
            case BankerType.CanNotBeBanker:
                SetApplyBankerBtnActive(true);
                break;
            }
        }
コード例 #6
0
ファイル: BankerCtrl.cs プロジェクト: narakai/chessgame
        /// <summary>
        /// 设置庄状态
        /// </summary>
        /// <param name="bt"></param>
        public void SetBankerType(BankerType bt)
        {
            CurBankerType = bt;
            switch (CurBankerType)
            {
            case BankerType.StayedBanker:
                BtnImage.GetComponent <UISprite>().spriteName    = "60";
                BankerBtn.GetComponent <UIButton>().normalSprite = "60";
                break;

            case BankerType.CanBecomeBanker:
                BtnImage.GetComponent <UISprite>().spriteName    = "4";
                BankerBtn.GetComponent <UIButton>().normalSprite = "4";
                break;

            case BankerType.CanNotBeBanker:
                BtnImage.GetComponent <UISprite>().spriteName    = "2"; //允许玩家点击按钮
                BankerBtn.GetComponent <UIButton>().normalSprite = "2";
                break;
            }
        }