コード例 #1
0
        public JsonResult ObtenerItem(int id)
        {
            var dbHelper = new ItemsHelper(ItemsHelper.GetConnection());
            var item     = dbHelper.ObtenerItem(id);

            return(Json(item, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }