Beispiel #1
0
        public async Task <ActionResult> Edit(MasterSlider model)
        {
            try
            {
                string           ImagePath  = "E:/Uploads" + "/" + model.Photo;
                byte[]           ImageData  = System.IO.File.ReadAllBytes(ImagePath);
                SliderRepository Repository = new SliderRepository();
                var result = await Repository.EditSlider(model.ID, ImageData, model.Judul, model.DesSingkat, model.DesPanjang);

                if (result == true)
                {
                    return(await GetList());
                }
                else
                {
                    return(View(result));
                }
            }
            catch
            {
                return(View(false));
            }
        }