public ActionResult Editar(int id) { try { using (var db = new inventoryContext()) { degrees deg = db.degrees.Find(id); return(View(deg)); } } catch (Exception ex) { throw; } }
public ActionResult Eliminar(int id) { try { using (var db = new inventoryContext()) { //para actualizar primero encuentro al alumno degrees deg = db.degrees.Find(id); //al es el alumno encontrado db.degrees.Remove(deg); db.SaveChanges(); return(RedirectToAction("Index2")); } } catch (Exception ex) { throw; } }
public ActionResult Editar(degrees a) { try { if (!ModelState.IsValid) // o sea si los datos estan bien, si numero es numero y asi { return(View()); //si el modelo es validor retona la vista } using (var db = new inventoryContext()) { //para actualizar primero encuentro al alumno degrees deg = db.degrees.Find(a.id); //al es el alumno encontrado deg.degrees1 = a.degrees1; //agregar ultima actualizacion db.SaveChanges(); return(RedirectToAction("Index2")); } } catch (Exception ex) { throw; } }
public ActionResult Agregar(degrees a) { if (!ModelState.IsValid) { return(View()); } try { using (var db = new inventoryContext()) { db.degrees.Add(a); db.SaveChanges(); return(RedirectToAction("Index2")); } } catch (Exception ex) { ModelState.AddModelError("", "Error"); return(View()); } }
_SetPunctualLight(idx, PBRPunctualLight.Directional(degrees, color.ToVector3(), intensity));
return(new vec2(degrees(radians.x), degrees(radians.y)));