Пример #1
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);
        }
Пример #2
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);
        }