protected override void OnBeforeInsert(ItemsDetail info)
        {
            //留给子类对参数对象进行修改
            info.Id            = GuidUtils.CreateNo();
            info.CreatorTime   = DateTime.Now;
            info.CreatorUserId = CurrentUser.UserId;
            info.DeleteMark    = false;
            if (info.SortCode == null)
            {
                info.SortCode = 99;
            }
            bool bltree = itemsService.Get(info.ItemId).IsTree;

            if (bltree)
            {
                if (string.IsNullOrEmpty(info.ParentId))
                {
                    info.Layers   = 1;
                    info.ParentId = "";
                }
                else
                {
                    info.Layers = iService.Get(info.ParentId).Layers + 1;
                }
            }
            else
            {
                info.ParentId = "";
            }
        }
Esempio n. 2
0
        // Read by id
        public HttpResponseMessage Get(int id)
        {
            var item = _itemsService.Get(id);

            if (item == null)
            {
                Request.CreateResponse(HttpStatusCode.NotFound);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, ItemViewModel.MapFromEntity(item)));
        }
        public IHttpActionResult Get()
        {
            var model = LoadService.Get(1);

            model.Items = ItemsService.Get(model.Id);

            // return new HtmlActionResult("<b>Hello</b>");

            return(new RazorActionResult("Dashboard", model));
        }
Esempio n. 4
0
        public JsonResult Get(int id)
        {
            if (id < 1)
            {
                return(Json(new { message = "Товар не найден" }));
            }
            ItemsModel itemsModel = itemsService.Get(id);

            if (itemsModel == null)
            {
                return(Json(new { message = "Товар не найден" }));;
            }

            return(Json(new { message = itemsModel }));;
        }
Esempio n. 5
0
        public IActionResult Pobierz()
        {
            var items = itemsService.Get();

            return(Ok(items));
        }
Esempio n. 6
0
 public IActionResult Get()  //GET - pobierz
 {
     return(Ok(_itemService.Get()));
 }
Esempio n. 7
0
 public async Task <Item> Get(int id)
 => await _memoryCache.GetOrCreateAsync(
     $"{_typeName}-Get-{id}",
     entry => _itemsService.Get(id));
        private void Load()
        {
            Schema = schemasService.Get(1);

            Schema.Items = itemsService.Get();
        }
Esempio n. 9
0
 public ActionResult <List <Item> > Get() =>
 _itemsService.Get();
 protected virtual void Load()
 {
     Items = itemsService.Get();
 }