public ActionResult DeleteConfirmed(int id) { BankerType bankerType = db.BankerType.Find(id); db.BankerType.Remove(bankerType); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
public ActionResult Create([Bind(Include = "ID,Name")] BankerType bankerType) { if (ModelState.IsValid) { db.BankerType.Add(bankerType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bankerType)); }
// 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)); }
/// <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; } }
/// <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; } }