public Pieza GetPieza(char key) { Pieza piezas = null; if (_piezas.ContainsKey(key)) { piezas = _piezas[key]; } else { switch (key) { case 'P': piezas = new Peon(key); break; case 'R': piezas = new Rey(key); break; case 'r': piezas = new Reina(key); break; case 'C': piezas = new Caballo(key); break; case 'A': piezas = new Alfil(key); break; case 'T': piezas = new Torre(key); break; case 'D': piezas = new Dama(key); break; } _piezas.Add(key, piezas); } return(piezas); }
public ActionResult DeleteConfirmed(int id) { Rey rey = db.Reys.Find(id); db.Reys.Remove(rey); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult ReySil(int id) { Rey r = ReyORM.Current.SelectById(id).Data[0]; r.IsActive = false; int b = r.MeqaleID; ReyORM.Current.Update(r); return(RedirectToAction("Meqale", "Home", new { id = b })); }
public ActionResult Edit([Bind(Include = "id_reys,train_id,start_point,end_point,start_date,end_date")] Rey rey) { if (ModelState.IsValid) { db.Entry(rey).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.train_id = new SelectList(db.Trains, "id_train", "id_train", rey.train_id); return(View(rey)); }
public ActionResult Rey(Rey r) { int b = r.MeqaleID; r.IsActive = true; r.Tarixi = DateTime.Now; r.UserName = UserORM.Current.GetUserById(r.UserID); bool a = ReyORM.Current.Insert(r).Data; return(RedirectToAction("Meqale", "Home", new { id = b })); }
public ActionResult Sil(int reyId) { Rey r = ReyORM.Current.SelectById(reyId).Data[0]; r.IsActive = false; int b = r.MeqaleID; bool a = ReyORM.Current.Update(r).Data; if (a == false) { return(View(0)); } return(RedirectToAction("Gor", "Rey", new { id = b })); }
// GET: Reys/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Rey rey = db.Reys.Find(id); if (rey == null) { return(HttpNotFound()); } return(View(rey)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Rey rey = db.Reys.Find(id); if (rey == null) { return(HttpNotFound()); } ViewBag.train_id = new SelectList(db.Trains, "id_train", "id_train", rey.train_id); return(View(rey)); }
// [Route("[controller]/[action]")] //[Authorize] public async Task <IActionResult> WriteCommentt(int id, string text) { if (string.IsNullOrEmpty(text.Trim())) { return(Content("false")); } User user = await userManager.FindByNameAsync(User.Identity.Name); Rey comment = new Rey { MeqaleId = id, dateTime = DateTime.Now, Text = text, UserId = user.Id }; db.Reyler.Add(comment); await db.SaveChangesAsync(); comment.User = user; return(PartialView("_CommentPartial", comment)); }
public ToonStats() { ht = new HT(); mf = new MF(); nego = new Nego(); traya = new Traya(); en = new EN(); padme = new Padme(); jkr = new JKR(); grievous = new Grievous(); bsf = new BSF(); bossk = new Bossk(); gba = new GBA(); mal = new Malevolence(); dr = new DR(); dm = new DM(); gas = new GAS(); rey = new Rey(); slkr = new SLKR(); }