public async Task <IActionResult> Edit(int id, [Bind("Id,PBrand,PModel,PColor,PSize,PPrice,PSalePrice,PQtyOnHand,PImageUrl,PSizeCat")] Pant pant) { if (id != pant.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pant); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PantExists(pant.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pant)); }
public static ICloths CreatCloth (ECharacterResType type, UMAContext _umaContext, CharacterData _characterData, ICharacterSlotOverly _characterSlotOverlay, ICharacterPlayer _character, ICharacterBase _characterBase, ClothModel _cm) { ICloths ich = null; switch (_cm.wearpos) { case WearPosConst.WAER_POS_CLOTH: ich = new Coat(type, _umaContext, _characterData, _characterSlotOverlay, _character, _characterBase, _cm); break; case WearPosConst.WEAR_POS_PANT: ich = new Pant(type, _umaContext, _characterData, _characterSlotOverlay, _character, _characterBase, _cm); break; case WearPosConst.WEAR_POS_SUIT: ich = new Suit(type, _umaContext, _characterData, _characterSlotOverlay, _character, _characterBase, _cm); break; case WearPosConst.WAER_POS_HAIR: ich = new Hair(type, _umaContext, _characterData, _characterSlotOverlay, _character, _characterBase, _cm); break; case WearPosConst.WEAR_POS_SHOE: ich = new Shoe(type, _umaContext, _characterData, _characterSlotOverlay, _character, _characterBase, _cm); break; } return(ich); }
public ActionResult createPant(Pant pantToCreate) { { PantsDataAccess.createPant(_Mapper.Map(pantToCreate)); return(RedirectToAction("PantView")); } }
public ActionResult DeleteConfirmed(int id) { Pant pant = db.Pants.Find(id); db.Pants.Remove(pant); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PantsID,Name,Photo,Type,Color,Season,Occasion")] Pant pant) { if (ModelState.IsValid) { db.Entry(pant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pant)); }
public ActionResult UpdatePant(Pant pantToUpdate) { if ((int)Session["RoleID"] == 1) { PantsDataAccess.UpdatePant(_Mapper.Map(pantToUpdate)); return(RedirectToAction("ViewPant")); } return(View()); }
public async Task <IActionResult> Create([Bind("Id,PBrand,PModel,PColor,PSize,PPrice,PSalePrice,PQtyOnHand,PImageUrl,PSizeCat")] Pant pant) { if (ModelState.IsValid) { _context.Add(pant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pant)); }
public ActionResult Create([Bind(Include = "PantsID,Name,Photo,Type,Color,Season,Occasion")] Pant pant) { if (ModelState.IsValid) { db.Pants.Add(pant); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pant)); }
public ActionResult Edit([Bind(Include = "PantsId,PantsName,PantsType,PantsColor,PantsPhoto,OccassionID,SeasonID")] Pant pant) { if (ModelState.IsValid) { db.Entry(pant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OccassionID = new SelectList(db.Occassions, "OccassionID", "OccassionName", pant.OccassionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "SeasonName", pant.SeasonID); return(View(pant)); }
// GET: Pants/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pant pant = db.Pants.Find(id); if (pant == null) { return(HttpNotFound()); } return(View(pant)); }
public ActionResult Edit([Bind(Include = "PantId,PantName,PantPhoto,PantTypeId,PantColorId,PantSeasonId,PantOccasionId,PantNotes")] Pant pant) { if (ModelState.IsValid) { db.Entry(pant).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PantColorId = new SelectList(db.PantColors, "PantColorId", "PantColor1", pant.PantColorId); ViewBag.PantOccasionId = new SelectList(db.PantOccasions, "PantOccasionId", "PantOccasions", pant.PantOccasionId); ViewBag.PantSeasonId = new SelectList(db.PantSeasons, "PantSeasonId", "PantSeason1", pant.PantSeasonId); ViewBag.PantTypeId = new SelectList(db.PantTypes, "PantTypeId", "PantType1", pant.PantTypeId); return(View(pant)); }
// GET: Pants/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pant pant = db.Pants.Find(id); if (pant == null) { return(HttpNotFound()); } ViewBag.OccassionID = new SelectList(db.Occassions, "OccassionID", "OccassionName", pant.OccassionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "SeasonName", pant.SeasonID); return(View(pant)); }
// GET: Pants/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Pant pant = db.Pants.Find(id); if (pant == null) { return(HttpNotFound()); } ViewBag.PantColorId = new SelectList(db.PantColors, "PantColorId", "PantColor1", pant.PantColorId); ViewBag.PantOccasionId = new SelectList(db.PantOccasions, "PantOccasionId", "PantOccasions", pant.PantOccasionId); ViewBag.PantSeasonId = new SelectList(db.PantSeasons, "PantSeasonId", "PantSeason1", pant.PantSeasonId); ViewBag.PantTypeId = new SelectList(db.PantTypes, "PantTypeId", "PantType1", pant.PantTypeId); return(View(pant)); }
public PantCondition(bool yes, Pant pant){ this.yes = yes; this.pant = pant; }
// Constructeur public Skin() { this.beard = new Beard(); this.hair = new Hair(); this.hat = new Hat(); this.body = new Body(); this.tshirt = new Tshirt(); this.pant = new Pant(); this.gloves = new Gloves(); this.eyes = new Eyes(); }
public Skin(Beard beard, Hair hair, Hat hat, Body body, Tshirt tshirt, Pant pant, Gloves gloves, Eyes eyes) { this.beard = beard; this.hair = hair; this.hat = hat; this.body = body; this.tshirt = tshirt; this.pant = pant; this.gloves = gloves; this.eyes = eyes; }
private void btnCreate_Click(object sender, RoutedEventArgs e) { String optionCharacter = CboxCharacter.Text; String optionWeapon = CboxWeapon.Text; String optionAmor = CboxAmor.Text; String optionRace = CboxRace.Text; String name = txtName.Text; Character myCharacter; switch (optionCharacter) { case "Cleric": myCharacter = new Cleric(); myCharacter.Name = name; myCharacter.Level = 0; myCharacter.Experience = 0; break; case "Fighter": myCharacter = new Fighter(); myCharacter.Name = name; myCharacter.Level = 0; myCharacter.Experience = 0; break; case "Rouge": myCharacter = new Rouge(); myCharacter.Name = name; myCharacter.Level = 0; myCharacter.Experience = 0; break; case "Wizard": myCharacter = new Wizard(); myCharacter.Name = name; myCharacter.Level = 0; myCharacter.Experience = 0; break; default: myCharacter = null; MessageBox.Show("You MUST select a type"); break; } switch (optionRace) { case "Dwarf": myCharacter.Race = Character.Races.Dwarf.ToString(); break; case "Elf": myCharacter.Race = Character.Races.Elf.ToString(); break; case "Hobbit": myCharacter.Race = Character.Races.Hobbit.ToString(); break; case "Human": myCharacter.Race = Character.Races.Human.ToString(); break; case "Orc": myCharacter.Race = Character.Races.Orc.ToString(); break; default: MessageBox.Show("You MUST select a race"); break; } switch (optionWeapon) { case "Axe": Axe axe = new Axe(9); myCharacter.ListEquipment.Add(axe); break; case "Sword": Sword sword = new Sword(6); myCharacter.ListEquipment.Add(sword); break; case "Potion": Potion potion = new Potion(10); myCharacter.ListEquipment.Add(potion); break; case "Staff": Staff staff = new Staff(8); myCharacter.ListEquipment.Add(staff); break; case "knife": knife knife = new knife(5); myCharacter.ListEquipment.Add(knife); break; default: MessageBox.Show("You MUST select a weapon"); break; } switch (optionAmor) { case "Helmet": Helmet helmet = new Helmet(3); myCharacter.ListEquipment.Add(helmet); break; case "Shirt": Shirt shirt = new Shirt(4); myCharacter.ListEquipment.Add(shirt); break; case "Pant": Pant pant = new Pant(2); myCharacter.ListEquipment.Add(pant); break; default: MessageBox.Show("You MUST select an amor"); break; } if (checkAxe.IsChecked == true) { Axe axe = new Axe(9); myCharacter.Inventory.Add(axe); checkAxe.IsChecked = false; } if (checkHelmet.IsChecked == true) { Helmet helmet = new Helmet(3); myCharacter.Inventory.Add(helmet); checkHelmet.IsChecked = false; } if (checkKnife.IsChecked == true) { knife knife = new knife(5); myCharacter.Inventory.Add(knife); checkKnife.IsChecked = false; } if (checkPant.IsChecked == true) { Pant pant = new Pant(2); myCharacter.Inventory.Add(pant); checkPant.IsChecked = false; } if (checkPotion.IsChecked == true) { Potion potion = new Potion(10); myCharacter.Inventory.Add(potion); checkPotion.IsChecked = false; } if (checkShirt.IsChecked == true) { Shirt shirt = new Shirt(4); myCharacter.Inventory.Add(shirt); checkShirt.IsChecked = false; } if (checkStaff.IsChecked == true) { Staff staff = new Staff(8); myCharacter.Inventory.Add(staff); checkStaff.IsChecked = false; } if (checkSword.IsChecked == true) { Sword sword = new Sword(6); myCharacter.Inventory.Add(sword); checkSword.IsChecked = false; } if (name == "") { myCharacter = null; MessageBox.Show("You MUST write a name"); } if (myCharacter != null && myCharacter.ListEquipment.Count == 2 && myCharacter.Race != null) { var listAllCharacters = listCharacters.ListAllCharacters; listAllCharacters.Add(myCharacter); txtName.Text = null; nullListCharacter(); } }
public Pant(Pant pant) : base(pant) { this.color = pant.color; this.type = pant.type; }
public ActionResult CreatePant() { Pant pant = new Pant(); return(View()); }
private void temporizador_Tick(object sender, EventArgs e) { switch (Estado) { case Pant.HORARIOS: #region Horarios try { if (misHorarios[cntlab].Count > 0) { temporizador.Stop(); CuboHorario cbHoras = new CuboHorario(misHorarios[cntlab]); cbHoras.ShowDialog(); mostrarTransicion(); temporizador.Start(); } Estado = Pant.ALUMNOS; } catch (Exception) { Estado = Pant.ALUMNOS; } #endregion break; case Pant.AVISOS: #region Avisos try { if (lstAvisos.Count > 0) { temporizador.Stop(); wndAvisos avisos = new wndAvisos(lstAvisos); avisos.ShowDialog(); mostrarTransicion(); temporizador.Start(); } Estado = Pant.HORARIOS; } catch (Exception) { Estado = Pant.HORARIOS; } //Estado = Pant.ALUMNOS; #endregion break; case Pant.ALUMNOS: #region Alumnos try { //if (misSesiones[cntSes].Count > 0) //{ temporizador.Stop(); LayLaboratorio lays = new LayLaboratorio(nolab); lays.ShowDialog(); mostrarTransicion(); temporizador.Start(); //} Estado = Pant.FIN; } catch (Exception) { Estado = Pant.FIN; } #endregion break; case Pant.FIN: #region Termino de un secuencia para un laboratorio if (cntlab >= xLab) { cntlab = 0; isInicial = true; misHorarios.Clear(); misSesiones.Clear(); //obtenerActual(nolab); } else cntlab++; nolab = idlabs[cntlab]; index = 0; Estado = Pant.AVISOS; obtenerActual(nolab); #endregion break; } }
// Method public void Randomize() { List<Eyes> eyes = new List<Eyes>(); foreach (Eyes e in Clothing.Eyes) eyes.Add(e); this.eyes = eyes[Random.Range(0, eyes.Count - 1)]; List<Gloves> gloves = new List<Gloves>(); foreach (Gloves g in Clothing.Gloves) gloves.Add(g); this.gloves = gloves[Random.Range(0, gloves.Count - 1)]; List<Pant> pant = new List<Pant>(); foreach (Pant p in Clothing.Pants) pant.Add(p); this.pant = pant[Random.Range(0, pant.Count - 1)]; List<Tshirt> tshirt = new List<Tshirt>(); foreach (Tshirt t in Clothing.Tshirts) tshirt.Add(t); this.tshirt = tshirt[Random.Range(0, tshirt.Count - 1)]; List<Body> body = new List<Body>(); foreach (Body b in Clothing.Bodies) body.Add(b); this.body = body[Random.Range(0, body.Count - 1)]; List<Hair> hair = new List<Hair>(); foreach (Hair h in Clothing.Hairs) hair.Add(h); this.hair = hair[Random.Range(0, hair.Count - 1)]; if (this.hair.GetTypeHair == Hair.TypeHair.Crete) this.hat = Hat.NoneHat; else { List<Hat> hat = new List<Hat>(); foreach (Hat h in Clothing.Hats) hat.Add(h); this.hat = hat[Random.Range(0, hat.Count - 1)]; } List<Beard> beard = new List<Beard>(); foreach (Beard b in Clothing.Beards) beard.Add(b); this.beard = beard[Random.Range(0, beard.Count - 1)]; }