Aggiunta gestione (standardizzata) dell'anagrafica operatore...

This commit is contained in:
Samuele E. Locatelli
2016-10-06 10:44:12 +02:00
parent 0558519ff1
commit ff4e276eb2
10 changed files with 249 additions and 218 deletions
+39 -23
View File
@@ -19,9 +19,7 @@ namespace StockManMVC.Controllers
{
return View(db.Operator.ToList());
}
/// <summary>
/// Selezione operatore da ricerca chiave...
/// </summary>
@@ -40,25 +38,21 @@ namespace StockManMVC.Controllers
return answ;
}
// GET: Operators/Details/5
public ActionResult Details(string id)
// GET: Operators/Create (mode=std|full, opzionale)
public ActionResult Create(string mode)
{
if (id == null)
if (mode == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
mode = "full";
}
Operator @operator = db.Operator.Find(id);
if (@operator == null)
if (mode == "std")
{
return HttpNotFound();
return PartialView();
}
else
{
return View();
}
return View(@operator);
}
// GET: Operators/Create
public ActionResult Create()
{
return View();
}
// POST: Operators/Create
@@ -78,9 +72,13 @@ namespace StockManMVC.Controllers
return View(@operator);
}
// GET: Operators/Edit/5
public ActionResult Edit(string id)
// GET: Operators/Edit/5 (mode=std|full, opzionale)
public ActionResult Edit(string id, string mode)
{
if (mode == null)
{
mode = "full";
}
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
@@ -90,7 +88,14 @@ namespace StockManMVC.Controllers
{
return HttpNotFound();
}
return View(@operator);
if (mode == "std")
{
return PartialView(@operator);
}
else
{
return View(@operator);
}
}
// POST: Operators/Edit/5
@@ -109,9 +114,13 @@ namespace StockManMVC.Controllers
return View(@operator);
}
// GET: Operators/Delete/5
public ActionResult Delete(string id)
// GET: Operators/Delete/5 (mode=std|full, opzionale)
public ActionResult Delete(string id, string mode)
{
if (mode == null)
{
mode = "full";
}
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
@@ -121,7 +130,14 @@ namespace StockManMVC.Controllers
{
return HttpNotFound();
}
return View(@operator);
if (mode == "std")
{
return PartialView(@operator);
}
else
{
return View(@operator);
}
}
// POST: Operators/Delete/5