public ActionResult DeleteCourtType(int id) { if (Session["empName"] != null) { string name = Session["empName"].ToString(); var ss = _db.Employee.Where(d => d.employeeName == name).FirstOrDefault(); var _allowAll = _db.HowCanAcess.Where(s => s.employeeID == ss.id).FirstOrDefault(); if (_allowAll.Setting == true) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CourtType _courtType = _db.CourtType.Find(id); if (_courtType == null) { return(HttpNotFound()); } return(View(_courtType)); } } return(RedirectToAction("HavntAccess", "Employees")); }
private void Awake() { CourtType court_type = DataManager.Instance.court_type; int court_num = (int)court_type; if (court_type == CourtType.Random) { int n = Tools.EnumLength(typeof(CourtType)); int r = Random.Range(1, n); court_num = (court_num + r) % n; } for (int i = 0; i < transform.childCount; ++i) { if (i == court_num) { court = transform.GetChild(i).gameObject.GetComponent <Court>(); court.gameObject.SetActive(true); } else { transform.GetChild(i).gameObject.SetActive(false); } } }
public ActionResult DeleteConfirmed(int id) { CourtType courtType = db.CourtTypes.Find(id); db.CourtTypes.Remove(courtType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "CourtTypeId,Name,Description")] CourtType courtType) { if (ModelState.IsValid) { db.Entry(courtType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(courtType)); }
public ActionResult Create([Bind(Include = "CourtTypeId,Name,Description")] CourtType courtType) { if (ModelState.IsValid) { db.CourtTypes.Add(courtType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(courtType)); }
// GET: CourtType/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CourtType courtType = db.CourtTypes.Find(id); if (courtType == null) { return(HttpNotFound()); } return(View(courtType)); }
public ActionResult AddCourtType(CourtType courtType, string _type) { if (Session["empName"] != null) { string name = Session["empName"].ToString(); var ss = _db.Employee.Where(d => d.employeeName == name).FirstOrDefault(); var _allowAll = _db.HowCanAcess.Where(s => s.employeeID == ss.id).FirstOrDefault(); if (_allowAll.Setting == true) { courtType.TypeName = _type; _db.CourtType.Add(courtType); _db.SaveChanges(); return(RedirectToAction("CourtsIndexs")); } } return(RedirectToAction("HavntAccess", "Employees")); }
public ActionResult ConfiremDeleteCourt(int id) { if (Session["empName"] != null) { string name = Session["empName"].ToString(); var ss = _db.Employee.Where(d => d.employeeName == name).FirstOrDefault(); var _allowAll = _db.HowCanAcess.Where(s => s.employeeID == ss.id).FirstOrDefault(); if (_allowAll.Setting == true) { CourtType _courtType = _db.CourtType.Find(id); _db.CourtType.Remove(_courtType); _db.SaveChanges(); TempData["CourtDelete"] = "تم حذف نوع المحكمه بنجاح"; return(RedirectToAction("CourtsIndexs")); } } return(RedirectToAction("HavntAccess", "Employees")); }
public Court(int id, CourtType courtType) { Id = id; CourtType = courtType; }