public Tool Edit(Tool Tooltool) { ausv1Context.Tools.Attach(Tooltool); ausv1Context.ObjectStateManager.ChangeObjectState(Tooltool, EntityState.Modified); ausv1Context.SaveChanges(); return Tooltool; }
public ActionResult Create(Tool tool_tool) { if (ModelState.IsValid) { db.Create(tool_tool); return RedirectToAction("Index", "Home"); } ViewBag.idSuplier = new SelectList(db.GetSuppliers(), "idSupplier", "Code", tool_tool.idSuplier); ViewBag.idType = new SelectList(db.GetToolTypes(), "idType", "Code", tool_tool.idType); ViewBag.idUser = new SelectList(db.GetUsers(), "idUser", "Identification", tool_tool.idUser); //return View("Home\Index.cshtml"); return RedirectToAction("Index", "Home"); }
public bool Delete(Tool Tootool) { ausv1Context.Tools.DeleteObject(Tootool); ausv1Context.SaveChanges(); return true; }
public Tool Create(Tool Tooltool) { ausv1Context.Tools.AddObject(Tooltool); ausv1Context.SaveChanges(); return Tooltool; }
public ActionResult Edit(Tool tool_tool) { if (ModelState.IsValid) { db.Edit(tool_tool); return RedirectToAction("Index"); } ViewBag.idSuplier = new SelectList(db.GetSuppliers(), "idSupplier", "Code", tool_tool.idSuplier); ViewBag.idType = new SelectList(db.GetToolTypes(), "idType", "Code", tool_tool.idType); ViewBag.idUser = new SelectList(db.GetUsers(), "idUser", "Identification", tool_tool.idUser); return View(tool_tool); }
/// <summary> /// Deprecated Method for adding a new object to the Tools EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTools(Tool tool) { base.AddObject("Tools", tool); }
/// <summary> /// Create a new Tool object. /// </summary> /// <param name="idTool">Initial value of the idTool property.</param> /// <param name="active">Initial value of the Active property.</param> /// <param name="insDateTime">Initial value of the InsDateTime property.</param> /// <param name="updDateTime">Initial value of the UpdDateTime property.</param> public static Tool CreateTool(global::System.Int32 idTool, global::System.Boolean active, global::System.DateTimeOffset insDateTime, global::System.DateTimeOffset updDateTime) { Tool tool = new Tool(); tool.idTool = idTool; tool.Active = active; tool.InsDateTime = insDateTime; tool.UpdDateTime = updDateTime; return tool; }