private string itemdel4action(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; string result = "";; try { Business.Op.BusinessContractPropertyFee bc = new project.Business.Op.BusinessContractPropertyFee(); bc.load(jp.getValue("itemid")); int r = bc.delete(); if (r <= 0) { flag = "2"; } else { // ---- 删除费用明细 ---- } } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "itemdel4")); collection.Add(new JsonStringValue("flag", flag)); collection.Add(new JsonStringValue("liststr", createItemList4(jp.getValue("id"), "update"))); result = collection.ToString(); return(result); }
private string itemsave4action(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Op.BusinessContractPropertyFee bc = new project.Business.Op.BusinessContractPropertyFee(); if (jp.getValue("itemtp") == "update") { bc.load(jp.getValue("itemid")); bc.Entity.LastReviseDate = GetDate(); bc.Entity.LastReviser = user.Entity.UserName; } else { bc.Entity.RefRP = jp.getValue("id"); bc.Entity.LastReviseDate = GetDate(); bc.Entity.LastReviser = user.Entity.UserName; bc.Entity.CreateDate = DateTime.Now; bc.Entity.Creator = user.Entity.UserName; } //bc.Entity.SRVNo = jp.getValue("SRVNo"); //bc.Entity.RMID = jp.getValue("RMID"); //bc.Entity.RMArea = ParseDecimalForString(jp.getValue("RMArea")); bc.Entity.UnitPrice = ParseDecimalForString(jp.getValue("UnitPrice")); int r = bc.Save(); if (r <= 0) { flag = "2"; } else { if (jp.getValue("itemtp") == "update") { // ---- 修改费用明细 ---- } else { // ---- 增加费用明细 ---- } } } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "itemsave4")); collection.Add(new JsonStringValue("flag", flag)); collection.Add(new JsonStringValue("liststr", createItemList4(jp.getValue("id"), "update"))); return(collection.ToString()); }
//管理费、空调费 private string createItemList4(string RefRP, string type) { System.Text.StringBuilder sb = new System.Text.StringBuilder(""); sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort mt-5\" style=\"width:1040px; table-layout:fixed; margin:0px;\">"); sb.Append("<thead>"); sb.Append("<tr class=\"text-c\">"); sb.Append("<th style=\"width:5%\">序号</th>"); sb.Append("<th style=\"width:15%\">费用项目</th>"); sb.Append("<th style=\"width:20%\">房屋编号</th>"); sb.Append("<th style=\"width:15%\">出租面积</th>"); sb.Append("<th style=\"width:15%\">单价(元/㎡/月)</th>"); sb.Append("<th style=\"width:20%\">备注</th>"); sb.Append("<th style=\"width:10%\">操作</th>"); sb.Append("</tr>"); sb.Append("</thead>"); int r = 1; sb.Append("<tbody id=\"ItemBody4\">"); if (RefRP != Guid.Empty.ToString()) { Business.Op.BusinessContractPropertyFee bc = new project.Business.Op.BusinessContractPropertyFee(); foreach (Entity.Op.EntityContractPropertyFee it in bc.GetListQuery(RefRP)) { sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">"); sb.Append("<td align='center'>" + r.ToString() + "</td>"); sb.Append("<td>" + it.SRVName + "</td>"); sb.Append("<td>" + it.RMID + "</td>"); sb.Append("<td>" + it.RMArea.ToString("0.####") + "</td>"); sb.Append("<td>" + it.UnitPrice.ToString("0.####") + "</td>"); sb.Append("<td>" + it.Remark + "</td>"); if (type != "view") { sb.Append("<td><input class=\"btn btn-primary radius size-S\" type=\"button\" onclick=\"itemupdate4('" + it.RowPointer + "')\" value=\"修改\" /> <input class=\"btn btn-danger radius size-S\" type=\"button\" onclick=\"itemdel4('" + it.RowPointer + "')\" value=\"删除\" /></td>"); } else { sb.Append("<td><input class=\"btn btn-primary radius size-S\" type=\"button\" onclick=\"itemupdate4('" + it.RowPointer + "')\" value=\"查看\" /></td>"); } sb.Append("</tr>"); r++; } } sb.Append("</tbody>"); sb.Append("</table>"); return(sb.ToString()); }