示例#1
0
        //评分标准
        private void FillScoreStandard(CSPeriodScoreStandard dr, CSWorksTypeScoreStandard dr1, string i)
        {
            StringBuilder str = new StringBuilder();

            str.AppendLine("<div class=\"comments-scores-model\">");
            int    standardID   = dr == null ? dr1.StandardID  : dr.StandardID;
            int    score        = dr == null ? (int)dr1.Score : (int)dr.Score;
            string subStandard  = dr == null ? dr1.StandardDescription : dr.StandardDescription;
            string standardName = dr == null ? dr1.StandardName : dr.StandardName;

            //评分
            Panel div = new Panel();

            div.ID       = "div" + standardID;// dr["StandardID"];
            div.CssClass = "comments-scores-modelTitle";
            div.Controls.Add(new LiteralControl(standardName + "(" + score + "分)"));

            TextBox txtBox = new TextBox();

            txtBox.ID       = "txtFen" + standardID + "_" + score;
            txtBox.Text     = "0";
            txtBox.CssClass = "txtcss";
            txtBox.Attributes.Add("onfocus", "onft" + i + "(this)");
            txtBox.Attributes.Add("onblur", "onbt" + i + "(this)");
            txtBox.Attributes.Add("onchange", "checkInput(this)");
            div.Controls.Add(txtBox);
            Image img = new Image();

            img.Style.Add("visibility", "hidden");
            img.ID       = "img" + standardID;
            img.ImageUrl = "images/dui.png";
            div.Controls.Add(img);
            str.Append("<div class=\"comments-scores-divHidden\" id=\"HiddenDiv" + i + "\">");
            str.AppendLine("<ul>");
            string[] subsValue = subStandard.Split('\n');
            foreach (string strValue in subsValue)
            {
                str.AppendLine("<li>" + strValue + "</li>");
            }
            str.AppendLine("</ul>");
            str.AppendLine("</div>");
            divContent.Controls.Add(div);
            divContent.Controls.Add(new LiteralControl(str.ToString()));
            divContent.Controls.Add(new LiteralControl("</div>"));
        }
示例#2
0
        private void InitControlDetail(int i, CSPeriodScoreStandard drStandard1, CSWorksTypeScoreStandard drStandard2, ScoreStandard drStandard3, string score, string des, ref Table tbl)
        {
            string sName;
            string sID;
            string sDes;

            if (drStandard1 == null)
            {
                if (drStandard2 == null)
                {
                    sName = drStandard3.StandardName;
                    sID   = drStandard3.StandardID.ToString();
                    sDes  = drStandard3.Description;
                }
                else
                {
                    sName = drStandard2.StandardName;
                    sID   = drStandard2.StandardID.ToString();
                    sDes  = drStandard2.StandardDescription;
                }
            }
            else
            {
                sName = drStandard1.StandardName;
                sID   = drStandard1.StandardID.ToString();
                sDes  = drStandard1.StandardDescription;
            }
            TableRow  tRow;
            TableCell tCell;
            Label     lstStandard;
            TextBox   txtContent;

            tRow              = new TableRow();
            tCell             = new TableCell();
            lstStandard       = new Label();
            lstStandard.Width = 100;
            lstStandard.ID    = "lst" + i.ToString();
            lstStandard.Text  = sName;
            tCell.Controls.Add(lstStandard);

            tRow.Cells.Add(tCell);
            txtContent       = new TextBox();
            txtContent.ID    = "txtScore" + i.ToString() + "_" + sID;
            txtContent.Width = 20;
            if (score != "")
            {
                txtContent.Text = score;
            }
            tCell = new TableCell();
            tCell.Controls.Add(txtContent);
            tCell.Controls.Add(new LiteralControl("分(设置指标分数)"));

            tRow.Cells.Add(tCell);
            tbl.Rows.Add(tRow);

            lstStandard           = new Label();
            lstStandard.Width     = 400;
            lstStandard.ID        = "des" + i.ToString();
            lstStandard.Font.Size = 8;
            lstStandard.ForeColor = System.Drawing.Color.Gray;
            lstStandard.Text      = sDes;
            tRow             = new TableRow();
            tCell            = new TableCell();
            tCell.ColumnSpan = 2;
            tCell.Controls.Add(lstStandard);
            tRow.Cells.Add(tCell);
            tbl.Rows.Add(tRow);

            txtContent          = new TextBox();
            txtContent.ID       = "txtDes" + i.ToString();
            txtContent.TextMode = TextBoxMode.MultiLine;
            txtContent.Rows     = 5;
            txtContent.Width    = 400;
            if (des != "")
            {
                txtContent.Text = des;
            }
            else
            {
                txtContent.Text = "分条描述指标的具体评分标准";
            }
            tRow             = new TableRow();
            tCell            = new TableCell();
            tCell.ColumnSpan = 2;
            tCell.Controls.Add(txtContent);
            tRow.Cells.Add(tCell);
            tbl.Rows.Add(tRow);
        }