public GallaryModel GetGallaryId(int Id) { GallaryModel result = new GallaryModel(); return(result); }
public int UpdateGallary(GallaryModel obj) { int result = 0; result = _gallaryDL.UpdateGallary(obj); return(result); }
public GallaryModel GetNewsId(int id) { GallaryModel result = new GallaryModel(); result = _gallaryDL.GetGallaryId(id); return(result); }
public int InsertGallary(GallaryModel obj) { int result = 0; result = _gallaryDL.InsertGallary(obj); return(result); }
public async Task <IActionResult> Addbook(BookModel book) { if (ModelState.IsValid) { if (book.CoverPhoto != null) { string folder = "books/cover/"; book.CoverImageURL = await UploadImage(folder, book.CoverPhoto); } if (book.GallaryFiles != null) { string folder = "books/Gallary/"; book.Gallary = new List <GallaryModel>(); foreach (var file in book.GallaryFiles) { var gallary = new GallaryModel() { Name = file.FileName, URL = await UploadImage(folder, file) }; book.Gallary.Add(gallary); } } int id = await _bookrepository.AddBook(book); if (id > 0) { return(RedirectToAction(nameof(Addbook), new { IsSuccess = true, BookId = id })); } } ViewBag.language = new SelectList(await _languagerepository.GetAllLanguages(), "LanguageId", "Name", 1); return(View()); }