public ActionResult Create() { var result = Authenticate(); if (result == 1) { ViewBag.Cinema = cinemaService.GetAll(); ViewBag.RoomType = roomTypeService.GetAll(); return(View()); } else { return(View("Error404")); } }
// GET: Admin/RoomType public ActionResult Index() { var result = Authenticate(); if (result == 1) { return(View(roomTypeService.GetAll())); } else { return(View("Error404")); } }
public async Task <ResponceModel> GetAll([FromQuery(Name = "text")] string text, [FromQuery(Name = "page")] int page = 1, [FromQuery(Name = "offset")] int offset = 20) { try { var roomTypes = await roomTypeService.GetAll(text, page, offset); return(new ResponceModel(200, "OK", roomTypes, null)); } catch (Exception ex) { await _logService.Add(new SystemLog() { Content = ex.Message, CreateDate = DateTime.Now, UserId = 0, EntityName = roomTypeService.GetType().Name }); return(new ResponceModel(500, "ERROR", null, new string[] { "Veriler getitilirken sorun oluştu." })); } }