private string createList(string CANo, string CAName, string CASPNo, int page) { System.Text.StringBuilder sb = new System.Text.StringBuilder(""); sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">"); sb.Append("<thead>"); sb.Append("<tr class=\"text-c\">"); sb.Append("<th width=\"5%\">序号</th>"); sb.Append("<th width='20%'>费用科目编号</th>"); sb.Append("<th width='25%'>费用科目名称</th>"); sb.Append("<th width='25%'>服务商</th>"); sb.Append("<th width='25%'>应收账款科目编码</th>"); sb.Append("</tr>"); sb.Append("</thead>"); int r = 1; sb.Append("<tbody>"); Business.Base.BusinessChargeAccount bc = new project.Business.Base.BusinessChargeAccount(); foreach (Entity.Base.EntityChargeAccount it in bc.GetListQuery(CANo, CAName, CASPNo, page, pageSize)) { sb.Append("<tr class=\"text-c\" id=\"" + it.CANo + "\">"); sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>"); sb.Append("<td style=\"text-align:left;\">" + it.CANo + "</td>"); sb.Append("<td style=\"text-align:left;\">" + it.CAName + "</td>"); sb.Append("<td style=\"text-align:left;\">" + it.CASPName + "</td>"); sb.Append("<td style=\"text-align:left;\">" + it.APNo + "</td>"); sb.Append("</tr>"); r++; } sb.Append("</tbody>"); sb.Append("</table>"); sb.Append(Paginat(bc.GetListCount(CANo, CAName, CASPNo), pageSize, page, 7)); return(sb.ToString()); }
protected override void Page_Load(object sender, EventArgs e) { try { HttpCookie hc = getCookie("1"); if (hc != null) { string str = hc.Value.Replace("%3D", "="); userid = Encrypt.DecryptDES(str, "1"); user.load(userid); CheckRight(user.Entity, "pm/Base/Service.aspx"); if (!Page.IsCallback) { if (user.Entity.UserType.ToUpper() != "ADMIN") { string sqlstr = "select a.RightCode from Sys_UserRight a left join sys_menu b on a.MenuId=b.MenuID " + "where a.UserType='" + user.Entity.UserType + "' and menupath='pm/Base/Service.aspx'"; DataTable dt = obj.PopulateDataSet(sqlstr).Tables[0]; if (dt.Rows.Count > 0) { string rightCode = dt.Rows[0]["RightCode"].ToString(); if (rightCode.IndexOf("insert") >= 0) { Buttons += "<a href=\"javascript:;\" onclick=\"insert()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 添加</a> "; } if (rightCode.IndexOf("update") >= 0) { Buttons += "<a href=\"javascript:;\" onclick=\"update()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 修改</a> "; } if (rightCode.IndexOf("delete") >= 0) { Buttons += "<a href=\"javascript:;\" onclick=\"del()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\"></i> 删除</a> "; } if (rightCode.IndexOf("vilad") >= 0) { Buttons += "<a href=\"javascript:;\" onclick=\"valid()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 启用/停用</a> "; } } } else { Buttons += "<a href=\"javascript:;\" onclick=\"insert()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 添加</a> "; Buttons += "<a href=\"javascript:;\" onclick=\"update()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 修改</a> "; Buttons += "<a href=\"javascript:;\" onclick=\"del()\" class=\"btn btn-danger radius\"><i class=\"Hui-iconfont\"></i> 删除</a> "; Buttons += "<a href=\"javascript:;\" onclick=\"valid()\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 启用/停用</a> "; } list = createList(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 1); SRVTypeNo1Str = "<select class=\"input-text required\" id=\"SRVTypeNo1\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"请选择所属服务大类\">"; SRVTypeNo1Str += "<option value=\"\" selected></option>"; SRVTypeNo1StrS = "<select class=\"input-text size-MINI\" id=\"SRVTypeNo1S\" style=\"width:120px;\" >"; SRVTypeNo1StrS += "<option value=\"\" selected>全部</option>"; Business.Base.BusinessServiceType bc1 = new project.Business.Base.BusinessServiceType(); foreach (Entity.Base.EntityServiceType it in bc1.GetListQuery(string.Empty, string.Empty, "null", string.Empty, true)) { SRVTypeNo1Str += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>"; SRVTypeNo1StrS += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>"; } SRVTypeNo1Str += "</select>"; SRVTypeNo1StrS += "</select>"; SRVTypeNo2Str = "<select class=\"input-text required\" id=\"SRVTypeNo2\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"请选择所属服务小类\">"; SRVTypeNo2Str += "<option value=\"\" selected></option>"; SRVTypeNo2StrS = "<select class=\"input-text size-MINI\" id=\"SRVTypeNo2S\" style=\"width:120px;\">"; SRVTypeNo2StrS += "<option value=\"\" selected>全部</option>"; //Business.Base.BusinessServiceType bc2 = new project.Business.Base.BusinessServiceType(); //foreach (Entity.Base.EntityServiceType it in bc1.GetListQuery(string.Empty, string.Empty,"empty",string.Empty,true)) //{ // SRVTypeNo2Str += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>"; // SRVTypeNo2StrS += "<option value='" + it.SRVTypeNo + "'>" + it.SRVTypeName + "</option>"; //} SRVTypeNo2Str += "</select>"; SRVTypeNo2StrS += "</select>"; CANoStr = "<select class=\"input-text required\" id=\"CANo\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"财务收费科目不能为空\">"; CANoStr += "<option value=\"\" selected></option>"; CANoStrS = "<select class=\"input-text size-MINI\" id=\"CANoS\" style=\"width:120px;\" >"; CANoStrS += "<option value=\"\" selected>全部</option>"; Business.Base.BusinessChargeAccount bc2 = new project.Business.Base.BusinessChargeAccount(); foreach (Entity.Base.EntityChargeAccount it in bc2.GetListQuery(string.Empty, string.Empty, string.Empty)) { //CANoStr += "<option value='" + it.CANo + "'>" + it.CAName + " - " + it.CASPName + "</option>"; CANoStrS += "<option value='" + it.CANo + "'>" + it.CAName + " - " + it.CASPName + "</option>"; } CANoStr += "</select>"; CANoStrS += "</select>"; SRVSPNoStr = "<select class=\"input-text required\" id=\"SRVSPNo\" style=\"width:240px;\" data-valid=\"isNonEmpty\" data-error=\"请选择服务商\">"; SRVSPNoStr += "<option value=\"\"></option>"; SRVSPNoStrS = "<select class=\"input-text size-MINI\" id=\"SRVSPNoS\" style=\"width:120px;\" >"; SRVSPNoStrS += "<option value=\"\" selected>全部</option>"; Business.Base.BusinessServiceProvider tp = new project.Business.Base.BusinessServiceProvider(); foreach (Entity.Base.EntityServiceProvider it in tp.GetListQuery(string.Empty, string.Empty, true)) { SRVSPNoStr += "<option value='" + it.SPNo + "'>" + it.SPName + "</option>"; SRVSPNoStrS += "<option value='" + it.SPNo + "'>" + it.SPName + "</option>"; } SRVSPNoStr += "</select>"; SRVSPNoStrS += "</select>"; } } else { Response.Write(errorpage); return; } } catch { Response.Write(errorpage); return; } }