private string createList() { 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='25%'>项目</th>"); sb.Append("<th width='30%'>内容</th>"); sb.Append("<th width='20%'>服务项目</th>"); sb.Append("<th width='20%'>操作</th>"); sb.Append("</tr>"); sb.Append("</thead>"); int r = 1; sb.Append("<tbody>"); Business.Base.BusinessSetting bc = new project.Business.Base.BusinessSetting(); foreach (Entity.Base.EntitySetting it in bc.GetListQuery()) { sb.Append("<tr class=\"text-c\" id=\"" + it.SettingCode + "\">"); sb.Append("<td>" + r.ToString() + "</td>"); sb.Append("<td>" + it.SettingName + "</td>"); if (it.SettingType == "String") { if (it.SettingCode == "CurrParkNo") { sb.Append("<td><input class=\"input-text size-S\" type=\"text\" id=\"Val" + it.SettingCode + "\" value=\"" + it.StringValue + "\" /></td>"); } else { sb.Append("<td><select class=\"input-text size-S\" id=\"Val" + it.SettingCode + "\" />"); Business.Base.BusinessServiceProvider bs = new Business.Base.BusinessServiceProvider(); foreach (Entity.Base.EntityServiceProvider it1 in bs.GetListQuery(string.Empty, string.Empty, true)) { if (it.StringValue == it1.SPNo) { sb.Append("<option value=\"" + it1.SPNo + "\" selected=\"selected\">" + it1.SPName + "</option>"); } else { sb.Append("<option value=\"" + it1.SPNo + "\">" + it1.SPName + "</option>"); } } sb.Append("</select></td>"); } } else if (it.SettingType == "Int") { sb.Append("<td><input class=\"input-text size-S\" type=\"text\" id=\"Val" + it.SettingCode + "\" value=\"" + it.IntValue.ToString() + "\" onblur=\"validInt(this.id)\" /></td>"); } else if (it.SettingType == "Decimal") { sb.Append("<td><input class=\"input-text size-S\" type=\"text\" id=\"Val" + it.SettingCode + "\" value=\"" + it.DecimalValue.ToString("0.####") + "\" onblur=\"validDecimal(this.id)\" /></td>"); } else { sb.Append("<td><input class=\"input-text size-S\" type=\"text\" id=\"Val" + it.SettingCode + "\" disabled=\"disabled\" /></td>"); } if (it.SettingType == "String") { sb.Append("<td></td>"); } else { sb.Append("<td><select class=\"input-text size-S\" id=\"SRV" + it.SettingCode + "\" />"); Business.Base.BusinessService bs = new Business.Base.BusinessService(); foreach (Entity.Base.EntityService it1 in bs.GetListQuery(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty)) { if (it.SRVNo == it1.SRVNo) { sb.Append("<option value=\"" + it1.SRVNo + "\" selected=\"selected\">" + it1.SRVName + "</option>"); } else { sb.Append("<option value=\"" + it1.SRVNo + "\">" + it1.SRVName + "</option>"); } } sb.Append("</select></td>"); } sb.Append("<td><input class=\"btn btn-primary radius size-S\" type=\"button\" onclick=\"save('" + it.SettingCode + "')\" value=\" 保 存 \" /></td>"); sb.Append("</tr>"); r++; } sb.Append("</tbody>"); sb.Append("</table>"); 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/LateFee.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/LateFee.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> "; } } } 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> "; } list = createList(); Business.Base.BusinessService srv = new Business.Base.BusinessService(); SRVNoStr += "<select id=\"SRVNo\" class=\"input-text required\" data-valid=\"isNonEmpty\" data-error=\"费用科目不能为空\">"; SRVNoStr += "<option value=''></option>"; LateFeeSRVNoStr += "<select id=\"LateFeeSRVNo\" class=\"input-text required\" data-valid=\"isNonEmpty\" data-error=\"对应违约金科目不能为空\">"; LateFeeSRVNoStr += "<option value=''></option>"; foreach (Entity.Base.EntityService it in srv.GetListQuery("", "", "", "", "", "", "")) { SRVNoStr += "<option value='" + it.SRVNo + "'>" + it.SRVName + "</option>"; LateFeeSRVNoStr += "<option value='" + it.SRVNo + "'>" + it.SRVName + "</option>"; } SRVNoStr += "</select>"; LateFeeSRVNoStr += "</select>"; } } else { Response.Write(errorpage); return; } } catch { Response.Write(errorpage); return; } }