コード例 #1
0
        private void BindData()
        {
            DataTable myTable = newsClassBLL.GetData("");

            myTable  = pg.pagination(myTable, 20, "");
            pageInfo = pg.pageNumList;

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.AppendFormat("<tr id='tr_{0}'>", dr["ID"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["ID"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["ClassName"].ToString());
                sb.AppendFormat("<td>{0}</td>", dr["CreatedTime"].ToString());
                sb.Append("<td>");
                sb.AppendFormat("<a href='NewsClassEdit.aspx?id={0}'>修改</a> ", dr["ID"].ToString());
                sb.AppendFormat("<a href='javascript:void(0)' onclick='newsClassDelete({0})'>删除</a>", dr["ID"].ToString());
                sb.Append("</td>");

                sb.Append("</tr>");
            }

            dataNewsClassList = sb.ToString();
        }
コード例 #2
0
ファイル: NewsAdd.aspx.cs プロジェクト: winteroflove/qu17
        public void BindNewsClass()
        {
            ClassLibrary.BLL.NewsClass newsClassBLL = new ClassLibrary.BLL.NewsClass();
            DataTable myTable = newsClassBLL.GetData("ID in(" + newsClassIDs + ")");

            StringBuilder sb = new StringBuilder();

            foreach (DataRow dr in myTable.Rows)
            {
                sb.AppendFormat("<option value='{0}'>{1}</option>", dr["ID"].ToString(), dr["ClassName"].ToString());
            }

            newsClassList = sb.ToString();
        }
コード例 #3
0
        private void BindData()
        {
            DataTable myTable = newsClassBLL.GetData(" id =" + newsClassId);

            if (myTable.Rows.Count == 1)
            {
                newsClassId = Convert.ToInt32(myTable.Rows[0]["ID"]);
                className   = myTable.Rows[0]["ClassName"].ToString();
            }
            else
            {
                Function.goMessagePage("修改路线类型", "操作失败,数据不存在!", "RouteClass/RouteClassList.aspx");
            }
        }