public JsonResult ObtenerItem(int id) { var dbHelper = new ItemsHelper(ItemsHelper.GetConnection()); var item = dbHelper.ObtenerItem(id); return(Json(item, JsonRequestBehavior.AllowGet)); }
public ActionResult GuardarItem(Item item) { item.EmpresaId = 2; //todo item.Activo = true; var dbHelper = new ItemsHelper(ItemsHelper.GetConnection()); var message = dbHelper.GuardarItem(item); return(Json(item)); }
public JsonResult ObtenerItems() { var id_e = Convert.ToInt32(HttpContext.GetOwinContext().Authentication.User.Claims .FirstOrDefault(x => x.Type == ClaimTypes.Sid).Value); var dbHelper = new ItemsHelper(ItemsHelper.GetConnection()); var items = dbHelper.ObtenerItems(id_e); //todo: obtener correctamente el id return(Json(items, JsonRequestBehavior.AllowGet)); }