예제 #1
0
 public IActionResult AddCatalog(CatalogDto catalogWithFieldVerifying)
 {
     _directorySystemFacade.Add(new Catalog
     {
         Id   = catalogWithFieldVerifying.Id,
         Name = catalogWithFieldVerifying.Name,
         OrderInParentCatalog = catalogWithFieldVerifying.OrderInParentCatalog,
         ParentCatalogId      = catalogWithFieldVerifying.ParentCatalogId
     });
     return(RedirectToAction("Index", new { id = catalogWithFieldVerifying.ParentCatalogId }));
 }
예제 #2
0
 public IActionResult AddTextBlock(TextBlockDto textBlockWithFieldVerifying)
 {
     _directorySystemFacade.Add(new TextBlock
     {
         Id   = textBlockWithFieldVerifying.Id,
         Name = textBlockWithFieldVerifying.Name,
         OrderInParentCatalog = textBlockWithFieldVerifying.OrderInParentCatalog,
         ParentCatalogId      = textBlockWithFieldVerifying.ParentCatalogId,
         Text = textBlockWithFieldVerifying.Text
     });
     return(RedirectToAction("Index", "Catalog", new { id = textBlockWithFieldVerifying.ParentCatalogId }));
 }
예제 #3
0
        public IActionResult Upload(IFormFile upload)
        {
            Bitmap  bitmap  = new Bitmap(upload.OpenReadStream());
            Picture picture = new Picture {
                BinaryData = _pictureResizer.GetPictureBinaryData(bitmap)
            };

            _directorySystemFacade.Add(picture);
            return(Json(new Dictionary <string, string>
            {
                { "uploaded", "true" },
                { "url", $"/Admin/Picture/Get/{picture.Id.ToString()}" },
                { "width", "auto" },
                { "height", "auto" },
            }));
        }