Skip to content

Commit 3d8e865

Browse files
committed
CREATE ACTION RESULT CATEGORIA IN CONTROLLER FUNCIONARIO
1 parent e69868b commit 3d8e865

File tree

10 files changed

+24
-50
lines changed

10 files changed

+24
-50
lines changed

.vs/CoffeeForCode/v16/.suo

0 Bytes
Binary file not shown.

AppBancoDominio/Funcionario/Categoria.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ public class Categoria
1010
{
1111
public int cd_cat { get; set; }
1212
public string nm_cat { get; set; }
13+
1314
}
1415
}

CoffeeForCode/Controllers/FuncionarioController.cs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,38 @@ public ActionResult BuscaCliente(string btn, FormCollection frm)
167167

168168
return View();
169169
}
170-
public ActionResult Categoria()
170+
public ActionResult CategoriaProd()
171171
{
172172
return View();
173173
}
174-
175-
public ActionResult Cadastra_Cafe()
174+
[HttpPost]
175+
public ActionResult CategoriaProd(Categoria categoria)
176+
{
177+
if (ModelState.IsValid)
178+
{
179+
var metodoCategoria = new CategoriaDAO();
180+
return RedirectToAction("CadastrarProd");
181+
}
182+
return View(categoria);
183+
}
184+
public ActionResult CadastrarProd()
176185
{
177186
return View();
178187
}
179188

180-
181-
189+
[HttpPost]
190+
public ActionResult CadastrarProd(Categoria categoria)
191+
{
192+
if (ModelState.IsValid)
193+
{
194+
var metodoCategoria = new CategoriaDAO();
195+
return RedirectToAction("CadastrarProd");
196+
}
197+
return View(categoria);
198+
}
182199
public ActionResult Info()
183200
{
184201
return View();
185202
}
186203
}
187-
}
204+
}

CoffeeForCode/Views/Funcionario/Cadastra_Cafe.cshtml

Lines changed: 0 additions & 44 deletions
This file was deleted.

CoffeeForCode/bin/CoffeeForCode.dll

0 Bytes
Binary file not shown.

CoffeeForCode/bin/CoffeeForCode.pdb

0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)