Example #1
0
 public Tool Edit(Tool Tooltool)
 {
     ausv1Context.Tools.Attach(Tooltool);
     ausv1Context.ObjectStateManager.ChangeObjectState(Tooltool, EntityState.Modified);
     ausv1Context.SaveChanges();
     return Tooltool;
 }
Example #2
0
        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");
        }
Example #3
0
 public bool Delete(Tool Tootool)
 {
     ausv1Context.Tools.DeleteObject(Tootool);
     ausv1Context.SaveChanges();
     return true;
 }
Example #4
0
 public Tool Create(Tool Tooltool)
 {
     ausv1Context.Tools.AddObject(Tooltool);          
     ausv1Context.SaveChanges();
     return Tooltool;
 }
Example #5
0
        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);
        }
Example #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Tools EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTools(Tool tool)
 {
     base.AddObject("Tools", tool);
 }
Example #7
0
 /// <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;
 }