Ejemplo n.º 1
0
        public void Delete(int id)
        {
            ForumPickedImg f = ForumPickedImg.findById(id);

            if (f == null)
            {
                echo(lang("exDataNotFound"));
                return;
            }

            f.delete();

            redirect(Index);
        }
Ejemplo n.º 2
0
        public void Edit(int id)
        {
            target(Update, id);

            ForumPickedImg f = ForumPickedImg.findById(id);

            if (f == null)
            {
                echo(lang("exDataNotFound"));
                return;
            }

            bind("f", f);
        }
Ejemplo n.º 3
0
        public void Update(int id)
        {
            ForumPickedImg f = ForumPickedImg.findById(id);

            if (f == null)
            {
                echo(lang("exDataNotFound"));
                return;
            }

            f = ctx.PostValue(f) as ForumPickedImg;
            Result result = f.update();

            if (result.HasErrors)
            {
                run(Add);
            }
            else
            {
                echoToParentPart(lang("opok"));
            }
        }