Exemplo n.º 1
0
 public ActionResult EditChapter(int creativeId, int chapterId)
 {
     return(View(new RegisterCreativeModel()
     {
         creativeId = creativeId, chapterId = chapterId, Chapter = ChapterService.GetChapter(chapterId)
     }));
 }
Exemplo n.º 2
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Chapter chapter = ChapterService.GetChapter(id ?? 0);

            if (chapter == null)
            {
                return(HttpNotFound());
            }
            return(View(chapter));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Set tok entry
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool ChapterTok(Player plr, ref List <string> values)
        {
            int entry    = GetInt(ref values);
            int tokEntry = GetInt(ref values);

            Chapter_Info chapter = ChapterService.GetChapter((ushort)entry);
            Tok_Info     tok     = TokService.GetTok((ushort)entry);

            if (tok == null || chapter == null)
            {
                return(false);
            }

            chapter.TokEntry = (ushort)tokEntry;
            chapter.Dirty    = true;
            WorldMgr.Database.SaveObject(chapter);

            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Save chapter position
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool ChapterSave(Player plr, ref List <string> values)
        {
            int entry = GetInt(ref values);

            Chapter_Info info = ChapterService.GetChapter((ushort)entry);

            if (info == null)
            {
                return(false);
            }

            info.PinX = (ushort)plr.X;
            info.PinY = (ushort)plr.Y;

            plr.SendClientMessage("Saved [" + info.Name + "] to '" + plr.X + "','" + plr.Y + "'");

            info.Dirty = true;
            WorldMgr.Database.SaveObject(info);

            return(true);
        }
Exemplo n.º 5
0
        public IActionResult GetChapter(long id)
        {
            var data = service.GetChapter(id);

            return(Ok(data));
        }