Beispiel #1
0
        //获得数据
        protected string GetHtmlData()
        {
            DataTable     dt          = new DataTable();
            StringBuilder condition   = new StringBuilder();
            StringBuilder strHtmlData = new StringBuilder();

            try
            {
                if (txtD_Name.Text.Trim() != "")
                {
                    condition.AppendFormat(" and (D_Name like '%{0}%')", txtD_Name.Text.Trim());
                }
                if (ddlD_Type.SelectedValue != "-1")
                {
                    condition.AppendFormat(" and (D_Type='{0}')", ddlD_Type.SelectedValue);
                }
                dt = BLL.GetCommon_DictList(condition.ToString(), PageIndex, PageSize, out rCount, out pCount).Tables[0];
                int i = 0;

                strHtmlData.Append("<table class='table_list' cellpadding='0' cellspacing='0' >");
                strHtmlData.Append("<tr class='tr_title'>");
                strHtmlData.Append("<th style='width:20%;'>名称</th>");
                strHtmlData.Append("<th style='width:20%;'>类型</th>");
                strHtmlData.Append("<th style='width:20%;'>排序</th>");
                strHtmlData.Append("<th style='width:10%;'>值</th>");
                strHtmlData.Append("<th>备注</th>");
                strHtmlData.Append("<th style='width:15%;'>操作</th>");
                strHtmlData.Append("</tr>");
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    i++;
                    string css = string.Empty;
                    if (i % 2 == 0)
                    {
                        css = "tr_con_001";
                    }
                    else
                    {
                        css = "tr_con_002";
                    }
                    strHtmlData.Append("<tr class='" + css + "'>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Name"].ToString() + "</td>");
                    strHtmlData.Append("<td>" + GetD_Name(dt.Rows[j]["D_Type"].ToString()) + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Order"].ToString() + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Value"].ToString() + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Remark"].ToString() + "</td>");
                    strHtmlData.Append("<td>");
                    strHtmlData.AppendFormat("&nbsp;&nbsp;<input type=\"button\" title='修改字典信息' class=\"btn_modify\" onclick=\"showPopCommon_Dict('{0}',2);\" />", clsUtility.Encrypt(dt.Rows[j]["Common_Dict_ID"].ToString()));
                    strHtmlData.AppendFormat("|");
                    strHtmlData.AppendFormat("<input type=\"button\" class=\"btn_delete\" title='删除字典信息' onclick=\"DeleteItemDesc('{0}')\" />", clsUtility.Encrypt(dt.Rows[j]["Common_Dict_ID"].ToString()));
                    strHtmlData.Append("</td>");
                    strHtmlData.Append("</tr>");
                }
                strHtmlData.Append("</table>");
                if (i == 0)
                {
                    strHtmlData.Append(" <div class='nodata_div'>暂无数据</div>");
                }
            }
            catch (Exception ex)
            {
                new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace));
                throw ex;
            }
            return(strHtmlData.ToString());
        }
Beispiel #2
0
        protected string GetHtmlData()
        {
            try
            {
                Common_DictBLL bll    = new Common_DictBLL();
                DataTable      dt     = new DataTable();
                string         strSql = string.Empty;
                if (!string.IsNullOrEmpty(txtCName.Text.Trim()))
                {
                    strSql = " and D_Remark like '" + txtCName.Text.Trim() + "%'";
                }
                strSql += " and d_type=43 ";
                dt      = bll.GetCommon_DictList(strSql, PageIndex, PageSize, out rCount, out pCount).Tables[0];

                int           i           = 0;
                StringBuilder strHtmlData = new StringBuilder();
                strHtmlData.Append("<table class='table_list' cellpadding='0' cellspacing='0' >");
                strHtmlData.Append("<tr class='tr_title'>");
                strHtmlData.Append("<td style='width:30%;'>数据项名称</td>");
                strHtmlData.Append("<td style='width:30%;'>表名称</td>");
                strHtmlData.Append("<td style='width:30%;'>唯一ID</td>");
                strHtmlData.Append("<td style='width:10%;'>操作</td>");
                strHtmlData.Append("</tr>");

                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    i++;
                    string css = string.Empty;
                    if (i % 2 == 0)
                    {
                        css = "tr_con_001";
                    }
                    else
                    {
                        css = "tr_con_002";
                    }
                    strHtmlData.Append("<tr class='" + css + "'>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Remark"] + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["d_name"] + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["d_code"] + "</td>");

                    strHtmlData.Append("<td><input type=\"button\" title='编辑数据项信息' class=\"btn_modify\" onclick=\"showUpdateDataItemEdit('" + dt.Rows[j]["common_dict_id"] + "')\"/>|");
                    strHtmlData.Append("<input type=\"button\" title='删除数据项信息' class=\"btn_delete\" onclick=\"DeleteUpdateDataItem('" + dt.Rows[j]["common_dict_id"] + "')\"/>");
                    strHtmlData.Append("</td>  ");

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

                strHtmlData.Append("</table>");
                if (i == 0)
                {
                    strHtmlData.Append(" <div class='nodata_div'>暂无数据</div>");
                }
                return(strHtmlData.ToString());
            }
            catch (Exception ex)
            {
                new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace));
                throw ex;
            }
        }
        //获得数据
        protected string GetHtmlData()
        {
            DataTable     dt          = new DataTable();
            StringBuilder condition   = new StringBuilder();
            StringBuilder strHtmlData = new StringBuilder();

            try
            {
                if (txtD_Name.Text.Trim() != "")
                {
                    condition.AppendFormat(" and (D_Name like '%{0}%')", txtD_Name.Text.Trim());
                }
                if (ddlD_Type.SelectedValue != "-1")
                {
                    condition.AppendFormat(" and (D_Type='{0}')", ddlD_Type.SelectedValue);
                }
                if (loginUser.SysUser_ID != Rc.Common.Config.Consts.AdminID)
                {
                    //非级管理员按类型排除加载数据(0:字典类型,1资源类型,2资源类别,4试题类型,5教案类型)
                    condition.AppendFormat(" and D_Type not in ('{0}','{1}','{2}','{3}','{4}')"
                                           , "0", "1", "2", "4", "5");
                    //非级管理员按标识排除加载数据(资源类型中的:按目录属性生成)
                    condition.AppendFormat(" and Common_Dict_ID not in ('{0}')"
                                           , "f22bd0fd-73b6-4c73-9df0-8b3cb8489816");
                }

                dt = BLL.GetCommon_DictList(condition.ToString(), PageIndex, PageSize, out rCount, out pCount).Tables[0];
                int i = 0;

                strHtmlData.Append("<table class='table table-hover table-bordered'>");
                strHtmlData.Append("<thead>");
                strHtmlData.Append("<tr>");
                strHtmlData.Append("<th>名称</th>");
                strHtmlData.Append("<th>类型</th>");
                strHtmlData.Append("<th>排序</th>");
                //strHtmlData.Append("<th style='width:10%;'>值</th>");
                strHtmlData.Append("<th>备注</th>");
                strHtmlData.Append("<th>操作</th>");
                strHtmlData.Append("</tr>");
                strHtmlData.Append("</thead>");
                strHtmlData.Append("<tbody>");
                for (int j = 0; j < dt.Rows.Count; j++)
                {
                    i++;
                    strHtmlData.Append("<tr>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Name"].ToString() + "</td>");
                    strHtmlData.Append("<td>" + GetD_Name(dt.Rows[j]["D_Type"].ToString()) + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Order"].ToString() + "</td>");
                    //strHtmlData.Append("<td>" + dt.Rows[j]["D_Value"].ToString() + "</td>");
                    strHtmlData.Append("<td>" + dt.Rows[j]["D_Remark"].ToString() + "</td>");
                    strHtmlData.Append("<td class='opera'>");
                    if (UserFun.Edit)
                    {
                        strHtmlData.AppendFormat("<a href=\"javascript:;\" onclick=\"showPopCommon_Dict('{0}');\">编辑</a>", clsUtility.Encrypt(dt.Rows[j]["Common_Dict_ID"].ToString()));
                    }
                    if (UserFun.Delete)
                    {
                        strHtmlData.AppendFormat("<a href=\"javascript:;\" onclick=\"DeleteItemDesc('{0}')\">删除</a>", clsUtility.Encrypt(dt.Rows[j]["Common_Dict_ID"].ToString()));
                    }

                    strHtmlData.Append("</td>");
                    strHtmlData.Append("</tr>");
                }
                strHtmlData.Append("</tbody>");
                strHtmlData.Append("</table>");
                if (i == 0)
                {
                    strHtmlData.Append(" <div class='nodata'>暂无数据</div>");
                }
            }
            catch (Exception ex)
            {
                new BLL_clsAuth().AddLogErrorFromBS(Module_Id, string.Format("类:{0},方法:{1},错误信息:{2}, 详细:{3}", ex.TargetSite.DeclaringType.ToString(), ex.TargetSite.Name.ToString(), ex.Message, ex.StackTrace));
                throw ex;
            }
            return(strHtmlData.ToString());
        }