Ejemplo n.º 1
0
        //
        // GET: /Estoque/Create
        public ActionResult Create()
        {
            Estoque estoque = new Estoque();

            estoque.TipoUltimaTransacao = "Compra";

            ViewBag.IdMaterial = new SelectList(db.Material.OrderBy(m => m.Codigo), "Id", "Codigo");
            return View(estoque);
        }
Ejemplo n.º 2
0
        public ActionResult Create(Estoque estoque)
        {
            if (ModelState.IsValid)
            {
                db.Estoque.AddObject(estoque);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.IdMaterial = new SelectList(db.Material, "Id", "Codigo", estoque.IdMaterial);
            return View(estoque);
        }
Ejemplo n.º 3
0
 public ActionResult Edit(Estoque estoque)
 {
     if (ModelState.IsValid)
     {
         db.Estoque.Attach(estoque);
         db.ObjectStateManager.ChangeObjectState(estoque, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.IdMaterial = new SelectList(db.Material, "Id", "Codigo", estoque.IdMaterial);
     return View(estoque);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new Estoque object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="idMaterial">Initial value of the IdMaterial property.</param>
 /// <param name="quantidade">Initial value of the Quantidade property.</param>
 /// <param name="dataUltimaMovimentacao">Initial value of the DataUltimaMovimentacao property.</param>
 /// <param name="tipoUltimaTransacao">Initial value of the TipoUltimaTransacao property.</param>
 public static Estoque CreateEstoque(global::System.Int32 id, global::System.Int32 idMaterial, global::System.Int32 quantidade, global::System.Int32 dataUltimaMovimentacao, global::System.String tipoUltimaTransacao)
 {
     Estoque estoque = new Estoque();
     estoque.Id = id;
     estoque.IdMaterial = idMaterial;
     estoque.Quantidade = quantidade;
     estoque.DataUltimaMovimentacao = dataUltimaMovimentacao;
     estoque.TipoUltimaTransacao = tipoUltimaTransacao;
     return estoque;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Estoque EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEstoque(Estoque estoque)
 {
     base.AddObject("Estoque", estoque);
 }