Initiate InventoyTypes from a xlxs
Arrival mostly working
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Web.Mvc;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using InventoryTraker.Web.ActionResults;
|
||||
|
||||
namespace InventoryTraker.Web.Controllers
|
||||
@@ -9,5 +10,16 @@ namespace InventoryTraker.Web.Controllers
|
||||
{
|
||||
return new BetterJsonResult<T>() {Data = model};
|
||||
}
|
||||
|
||||
protected JsonResult PackageModelStateErrors()
|
||||
{
|
||||
var betterJsonResult = new BetterJsonResult();
|
||||
foreach (var err in ModelState.Where(ms => ms.Value.Errors.Any()))
|
||||
{
|
||||
betterJsonResult.AddError(
|
||||
err.Key + ": " + string.Join(", ", err.Value.Errors.Select(e => e.ErrorMessage)));
|
||||
}
|
||||
return betterJsonResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user