public void List()
        {
            set("addLink", to(Add));
            set("sortAction", to(SaveSort));

            List <LicenseType> list = LicenseType.GetAll();

            bindList("list", "data", list, bindLink);
        }
Example #2
0
        public void Add()
        {
            target(Create);

            dropList("categoryId", getRootList(), "Name=Id", "");
            dropList("fileItem.LicenseTypeId", LicenseType.GetAll(), "Name=Id", "");
            dropList("fileItem.Lang", FileLang.GetAll(), "Name=Name", "");
            set("subCategoriesJson", FileCategory.GetSubCatsJson());
            checkboxList("fileItem.PlatformIds", Platform.GetAll(), "Name=Id", "");

            set("authInfo", AdminSecurityUtils.GetAuthCookieJson(ctx));
            set("uploadLink", to(SaveUpload));
            set("jsPath", sys.Path.DiskJs);
        }
Example #3
0
        public void Edit(int id)
        {
            target(Update, id);

            FileItem f = FileItem.findById(id);

            bind(f);

            dropList("categoryId", getRootList(), "Name=Id", f.ParentCategoryId);
            dropList("fileItem.LicenseTypeId", LicenseType.GetAll(), "Name=Id", f.LicenseTypeId);
            dropList("fileItem.Lang", FileLang.GetAll(), "Name=Name", f.Lang);

            set("subCategoriesJson", FileCategory.GetSubCatsJson());
            checkboxList("fileItem.PlatformIds", Platform.GetAll(), "Name=Id", f.PlatformIds);

            editor("fileItem.Description", f.Description, "200px");

            set("authInfo", AdminSecurityUtils.GetAuthCookieJson(ctx));
            set("uploadLink", to(SaveUpload));
            set("jsPath", sys.Path.DiskJs);
        }
        public virtual void SaveSort()
        {
            int    id  = ctx.PostInt("id");
            String cmd = ctx.Post("cmd");

            LicenseType data = LicenseType.GetById(id);

            List <LicenseType> list = LicenseType.GetAll();

            if (cmd == "up")
            {
                new SortUtil <LicenseType>(data, list).MoveUp();
                echoRedirect("ok");
            }
            else if (cmd == "down")
            {
                new SortUtil <LicenseType>(data, list).MoveDown();
                echoRedirect("ok");
            }
            else
            {
                echoError(lang("exUnknowCmd"));
            }
        }