Esempio n. 1
0
        /*
        void CreateEditArea(PlaceHolder edit_holder, int i)
        {
            edit_holder.Controls.Clear();
            edit_holder.Controls.Add(new LiteralControl("<table class='edit'>"));

            // 标题
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            LiteralControl literal = new LiteralControl();
            literal.Text = this.GetString("标题");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_title = new TextBox();
            edit_title.Text = "";
            edit_title.ID = "edit_title" + i.ToString();
            edit_title.CssClass = "title";
            edit_holder.Controls.Add(edit_title);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));


            // 正文
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("正文");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_content = new TextBox();
            edit_content.Text = "";
            edit_content.ID = "edit_content" + i.ToString();
            edit_content.CssClass = "content";
            edit_content.TextMode = TextBoxMode.MultiLine;
            edit_holder.Controls.Add(edit_content);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));

            // 创建者
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("创建者");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_creator = new TextBox();
            edit_creator.Text = "";
            edit_creator.ID = "edit_creator" + i.ToString();
            edit_creator.CssClass = "creator";
            edit_creator.ReadOnly = true;
            edit_holder.Controls.Add(edit_creator);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));


            // 提交
            edit_holder.Controls.Add(new LiteralControl("<tr><td colspan='2'>"));

            Button submit_button = new Button();
            submit_button.ID = "submit_button" + i.ToString();
            submit_button.Text = this.GetString("提交评注");
            submit_button.Click += new EventHandler(submit_button_Click);
            edit_holder.Controls.Add(submit_button);

            edit_holder.Controls.Add(new LiteralControl("</td></tr></table>"));
        }
         * */

        PlaceHolder NewLine(int index,
            Control insertbefore)
        {
            PlaceHolder line = new PlaceHolder();
            line.ID = "line" + Convert.ToString(index);

            if (insertbefore == null)
                this.Controls.Add(line);
            else
            {
                int pos = this.Controls.IndexOf(insertbefore);
                this.Controls.AddAt(pos, line);
            }

            // 左侧文字
            LiteralControl literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(index) + "left";
            literal.Text = "<tr class='content'><td>";
            line.Controls.Add(literal);

            LiteralControl no = new LiteralControl();
            no.ID = "line" + Convert.ToString(index) + "_no";
            line.Controls.Add(no);

            // checkbox
            CheckBox checkbox = new CheckBox();
            checkbox.ID = "line" + Convert.ToString(index) + "checkbox";
            line.Controls.Add(checkbox);

            // 中间文字
            literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(index) + "middle";
            literal.Text = "";
            line.Controls.Add(literal);

            // commentcontrol
            CommentControl commentcontrol = new CommentControl();
            commentcontrol.ID = "line_" + Convert.ToString(index) + "_comment";
            commentcontrol.WantFocus -= new WantFocusEventHandler(commentcontrol_WantFocus);
            commentcontrol.WantFocus += new WantFocusEventHandler(commentcontrol_WantFocus);
            line.Controls.Add(commentcontrol);

            // 右侧文字
            literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(index) + "right";
            literal.Text = "</td></tr>";
            line.Controls.Add(literal);


            return line;
        }
Esempio n. 2
0
        void CreateInputLine(PlaceHolder line)
        {
            line.Controls.Clear();

            line.Controls.Add(new LiteralControl("<tr class='newreview'"));


            LiteralControl newreview_editor_style = new LiteralControl();
            newreview_editor_style.ID = "newreview_editor_style";
            newreview_editor_style.Text = "";
            line.Controls.Add(newreview_editor_style);

            line.Controls.Add(new LiteralControl("><td colspan='2'>"));

            CommentControl editor = new CommentControl();
            editor.ID = "editor";
            editor.EditAction = "new";
            if (string.IsNullOrEmpty(this.NewTitle) == false)
                editor.EditTitle = this.NewTitle;
            if (string.IsNullOrEmpty(this.NewState) == false)
                editor.EditState = this.NewState;
            editor.WantFocus += new WantFocusEventHandler(editor_WantFocus);
            editor.Submited += new SumitedEventHandler(editor_Submited);
            if (this.MinimizeNewReviewEdtior == true)
                editor.Minimized = "true";
            line.Controls.Add(editor);

            line.Controls.Add(new LiteralControl("</td></tr>"));
        }
Esempio n. 3
0
        void CreateInputLine(PlaceHolder line)
        {
            line.Controls.Clear();

            line.Controls.Add(new LiteralControl("<tr class='inputline'><td colspan='2'>"));

            PlaceHolder edit_holder = new PlaceHolder();
            edit_holder.ID = "edit_holder";
            line.Controls.Add(edit_holder);

            edit_holder.Controls.Add(new LiteralControl("<table class='edit'>"));


            // 存储库
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            LiteralControl literal = new LiteralControl();
            literal.Text = this.GetString("存储库");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            // DropDown
            DropDownList store_dbname = new DropDownList();
            store_dbname.ID = "store_dbname";
            // store_dbname.Width = new Unit("100%");
            store_dbname.CssClass = "store_dbname";
            edit_holder.Controls.Add(store_dbname);

            OpacApplication app = (OpacApplication)this.Page.Application["app"];
            List<string> dbnames = app.GetOrderRecommendStoreDbNames();
            store_dbname.Items.Clear();
            if (dbnames.Count > 0)
            {
                for (int i = 0; i < dbnames.Count; i++)
                {
                    store_dbname.Items.Add(dbnames[i]);
                }
            }
            else
            {
                // 还没有定义 读者新书目 存储库

                LiteralControl comment = new LiteralControl();
                comment.ID = "comment";
                comment.Text = "<span class='comment'>还没有定义任何角色名为 'orderRecommendStore' 的读者创建新书目存储库...</span>";
                edit_holder.Controls.Add(comment);
            }

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));


            // 题名
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("题名");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_biblio_title = new TextBox();
            edit_biblio_title.Text = "";
            edit_biblio_title.ID = "edit_biblio_title";
            edit_biblio_title.CssClass = "biblio_title";
            edit_holder.Controls.Add(edit_biblio_title);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));


            // 责任者
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("责任者");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_biblio_author = new TextBox();
            edit_biblio_author.Text = "";
            edit_biblio_author.ID = "edit_biblio_author";
            edit_biblio_author.CssClass = "biblio_author";
            edit_holder.Controls.Add(edit_biblio_author);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));

            // 出版者
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("出版者");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_biblio_publisher = new TextBox();
            edit_biblio_publisher.Text = "";
            edit_biblio_publisher.ID = "edit_biblio_publisher";
            edit_biblio_publisher.CssClass = "biblio_publisher";
            edit_holder.Controls.Add(edit_biblio_publisher);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));

            // ISBN/ISSN
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("ISBN/ISSN");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_biblio_isbn = new TextBox();
            edit_biblio_isbn.Text = "";
            edit_biblio_isbn.ID = "edit_biblio_isbn";
            edit_biblio_isbn.CssClass = "biblio_isbn";
            edit_holder.Controls.Add(edit_biblio_isbn);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));

            // 价格
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("价格");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_biblio_price = new TextBox();
            edit_biblio_price.Text = "";
            edit_biblio_price.ID = "edit_biblio_price";
            edit_biblio_price.CssClass = "biblio_price";
            edit_holder.Controls.Add(edit_biblio_price);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));


            // 摘要
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='left'>"));

            literal = new LiteralControl();
            literal.Text = this.GetString("摘要");    //
            edit_holder.Controls.Add(literal);

            edit_holder.Controls.Add(new LiteralControl("</td><td>"));

            TextBox edit_biblio_summary = new TextBox();
            edit_biblio_summary.Text = "";
            edit_biblio_summary.ID = "edit_biblio_summary";
            edit_biblio_summary.CssClass = "biblio_summary";
            edit_biblio_summary.TextMode = TextBoxMode.MultiLine;
            edit_holder.Controls.Add(edit_biblio_summary);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));

            // 提示文字
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='description' colspan='2'>"));

            LiteralControl description = new LiteralControl();
            description.ID = "edit_description";
            description.Text = this.GetString("还可详细阐述您的推荐意见如下(可选)") + ":";
            edit_holder.Controls.Add(description);

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));

            // CommentControl
            edit_holder.Controls.Add(new LiteralControl("<tr><td class='comment' colspan='2'>"));

            CommentControl commentcontrol = new CommentControl();
            commentcontrol.ID = "commentcontrol";
            edit_holder.Controls.Add(commentcontrol);
            commentcontrol.EditAction = "new";
            commentcontrol.ButtonSubmit.Visible = false;
            commentcontrol.ButtonCancel.Visible = false;
            commentcontrol.EditType = "订购征询";
            commentcontrol.OrderSuggestionHolder.Visible = false;
            commentcontrol.EditDescription.Visible = false;

            edit_holder.Controls.Add(new LiteralControl("</td></tr>"));


            // 提交
            edit_holder.Controls.Add(new LiteralControl("<tr><td colspan='2'>"));

            Button submit_button = new Button();
            submit_button.ID = "submit_button";
            submit_button.Text = this.GetString("提交");
            submit_button.Click += new EventHandler(submit_button_Click);
            edit_holder.Controls.Add(submit_button);

            edit_holder.Controls.Add(new LiteralControl("</td></tr></table>"));

            line.Controls.Add(new LiteralControl("</td></tr>"));
        }
Esempio n. 4
0
        // 新创建内容行
        PlaceHolder NewContentLine(Control content,
            int nLineNo,
            Control insertpos)
        {
            PlaceHolder line = new PlaceHolder();
            line.ID = "line" + Convert.ToString(nLineNo);

            if (insertpos != null)
            {
                int index = content.Controls.IndexOf(insertpos);
                content.Controls.AddAt(index, line);
            }
            else
            {
                content.Controls.Add(line);
            }

            // 左侧文字
            LiteralControl literal = new LiteralControl();
            literal.Text = "<tr class='contentup'><td class='no' rowspan='2'>";
            line.Controls.Add(literal);

            // 序号
            literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(nLineNo) + "_no";
            line.Controls.Add(literal);

            CheckBox checkbox = new CheckBox();
            checkbox.ID = "line" + Convert.ToString(nLineNo) + "_checkbox";
            line.Controls.Add(checkbox);

            literal = new LiteralControl();
            literal.Text = "</td><td class='path'>";
            line.Controls.Add(literal);

            // 记录标题
            Panel title = new Panel();
            title.ID = "line" + Convert.ToString(nLineNo) + "_title";
            title.CssClass = "title";
            line.Controls.Add(title);

            // 路径
            HyperLink hyper = new HyperLink();
            hyper.ID = "line" + Convert.ToString(nLineNo) + "_path";
            hyper.CssClass = "path";
            hyper.ToolTip = "书目记录路径";
            line.Controls.Add(hyper);

            literal = new LiteralControl();
            literal.Text = "</td></tr><tr class='contentdown'><td class='content'>";
            line.Controls.Add(literal);

            // 内容
            literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(nLineNo) + "_content";
            line.Controls.Add(literal);

            PlaceHolder layout_holder = new PlaceHolder();
            layout_holder.ID = "line" + Convert.ToString(nLineNo) + "_layout";
            line.Controls.Add(layout_holder);

            // 必要的控件
            BiblioControl bibliocontrol = new BiblioControl();
            bibliocontrol.ID = "line" + Convert.ToString(nLineNo) + "_biblio";
            line.Controls.Add(bibliocontrol);

            MarcControl marccontrol = new MarcControl();
            marccontrol.ID = "line" + Convert.ToString(nLineNo) + "_marc";
            line.Controls.Add(marccontrol);

            /*
            literal = new LiteralControl();
            sep.Text = "<div class='sep'>";
            this.Controls.Add(sep);
             * */

            ItemsControl itemscontrol = new ItemsControl();
            itemscontrol.ID = "line" + Convert.ToString(nLineNo) + "_items";
            line.Controls.Add(itemscontrol);

            /*
            literal = new LiteralControl();
            sep.Text = "<div class='sep'>";
            this.Controls.Add(sep);
             * */

            CommentsControl commentscontrol = new CommentsControl();
            commentscontrol.MinimizeNewReviewEdtior = this.MinimizeNewReviewEdtior;
            commentscontrol.ID = "line" + Convert.ToString(nLineNo) + "_comments";
            commentscontrol.WantFocus -= new WantFocusEventHandler(commentscontrol_WantFocus);
            commentscontrol.WantFocus += new WantFocusEventHandler(commentscontrol_WantFocus);
            line.Controls.Add(commentscontrol);

            ItemControl itemcontrol = new ItemControl();
            itemcontrol.ID = "line" + Convert.ToString(nLineNo) + "_item";
            line.Controls.Add(itemcontrol);

            CommentControl commentcontrol = new CommentControl();
            commentcontrol.ID = "line" + Convert.ToString(nLineNo) + "_comment";
            line.Controls.Add(commentcontrol);
            /*
            literal = new LiteralControl();
            literal.Text = "</td><td width='10%'>";
            line.Controls.Add(literal);

            // 操作
            literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(nLineNo) + "_oper";
            line.Controls.Add(literal);
             */

            literal = new LiteralControl();
            literal.Text = "</td></tr>";
            line.Controls.Add(literal);

            return line;
        }
Esempio n. 5
0
        // 新创建内容行
        PlaceHolder NewContentLine(Control content,
            int nLineNo,
            Control insertpos)
        {
            PlaceHolder line = new PlaceHolder();
            line.ID = "line" + Convert.ToString(nLineNo);

            if (insertpos != null)
            {
                int index = content.Controls.IndexOf(insertpos);
                content.Controls.AddAt(index, line);
            }
            else
            {
                content.Controls.Add(line);
            }

            // 左侧文字
            AutoIndentLiteral auto_literal = new AutoIndentLiteral();
            auto_literal.Text = "<%begin%><tr class='content'><%begin%><td class='no";  // contentup
            line.Controls.Add(auto_literal);

            LiteralControl line_class = new LiteralControl();
            line_class.ID = "line" + Convert.ToString(nLineNo) + "_class";
            line.Controls.Add(line_class);

            line.Controls.Add(new LiteralControl("' >"));   // rowspan='2'

            // 序号
            LiteralControl literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(nLineNo) + "_no";
            line.Controls.Add(literal);

            // checkbox
            CheckBox checkbox = new CheckBox();
            checkbox.ID = "line" + Convert.ToString(nLineNo) + "_checkbox";
            checkbox.CssClass = "comment_checkbox";
            checkbox.Attributes.Add("onclick", "onColumnCheckboxClick(this);");
            line.Controls.Add(checkbox);

            auto_literal = new AutoIndentLiteral();
            auto_literal.Text = "<%end%></td>"; // "<%begin%><td class='path'>";
            line.Controls.Add(auto_literal);

            auto_literal = new AutoIndentLiteral();
            auto_literal.Text = "<%begin%><td class='review'>";
            line.Controls.Add(auto_literal);

            // 一个评注
            CommentControl comment = new CommentControl();
            comment.ID = "line" + Convert.ToString(nLineNo) + "_comment";
            comment.WantFocus -= new WantFocusEventHandler(commentcontrol_WantFocus);
            comment.WantFocus += new WantFocusEventHandler(commentcontrol_WantFocus);
            line.Controls.Add(comment);

            auto_literal = new AutoIndentLiteral();
            auto_literal.Text = "<%end%></td><%begin%><td class='biblio'>";
            line.Controls.Add(auto_literal);

            // 书目摘要
            literal = new LiteralControl();
            literal.ID = "line" + Convert.ToString(nLineNo) + "_bibliosummary";
            line.Controls.Add(literal);

            // 创建新评注
            Button newreview = new Button();
            newreview.Text = this.GetString("新评注");
            newreview.ID = "line" + Convert.ToString(nLineNo) + "_newreview";
            newreview.CssClass = "newreview";
            newreview.ToolTip = this.GetString("为按钮下方的书目记录创建一条新评注");
            newreview.Visible = false;
            line.Controls.Add(newreview);

            PlaceHolder biblioinfo_holder = new PlaceHolder();
            biblioinfo_holder.ID = "line" + Convert.ToString(nLineNo) + "_biblioinfo_holder";
            line.Controls.Add(biblioinfo_holder);

            BiblioControl bibliocontrol = new BiblioControl();
            bibliocontrol.ID = "line_" + nLineNo.ToString() + "_bibliocontrol";
            bibliocontrol.WantFocus -= new WantFocusEventHandler(bibliocontrol_WantFocus);
            bibliocontrol.WantFocus += new WantFocusEventHandler(bibliocontrol_WantFocus);
            biblioinfo_holder.Controls.Add(bibliocontrol);

            auto_literal = new AutoIndentLiteral();
            auto_literal.Text = "<%end%></td><%end%></tr>";
            line.Controls.Add(auto_literal);
            return line;
        }