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 })); }
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 })); }
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" }, })); }