private string viewaction(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Op.BusinessContract bc = new project.Business.Op.BusinessContract(); bc.load(jp.getValue("id")); collection.Add(new JsonStringValue("ContractNo", bc.Entity.ContractNo)); collection.Add(new JsonStringValue("ContractType", bc.Entity.ContractType)); collection.Add(new JsonStringValue("ContractSPNo", bc.Entity.ContractSPNo)); collection.Add(new JsonStringValue("ContractCustNo", bc.Entity.ContractCustNo)); collection.Add(new JsonStringValue("ContractCustName", bc.Entity.ContractCustName)); collection.Add(new JsonStringValue("ContractNoManual", bc.Entity.ContractNoManual)); collection.Add(new JsonStringValue("ContractHandler", bc.Entity.ContractHandler)); collection.Add(new JsonStringValue("ContractSignedDate", ParseStringForDate(bc.Entity.ContractSignedDate))); collection.Add(new JsonStringValue("ContractStartDate", ParseStringForDate(bc.Entity.ContractStartDate))); collection.Add(new JsonStringValue("ContractEndDate", ParseStringForDate(bc.Entity.ContractEndDate))); collection.Add(new JsonStringValue("EntryDate", ParseStringForDate(bc.Entity.EntryDate))); collection.Add(new JsonStringValue("FeeStartDate", ParseStringForDate(bc.Entity.FeeStartDate))); collection.Add(new JsonStringValue("ReduceStartDate1", ParseStringForDate(bc.Entity.ReduceStartDate1))); collection.Add(new JsonStringValue("ReduceEndDate1", ParseStringForDate(bc.Entity.ReduceEndDate1))); collection.Add(new JsonStringValue("ReduceStartDate2", ParseStringForDate(bc.Entity.ReduceStartDate2))); collection.Add(new JsonStringValue("ReduceEndDate2", ParseStringForDate(bc.Entity.ReduceEndDate2))); collection.Add(new JsonStringValue("ReduceStartDate3", ParseStringForDate(bc.Entity.ReduceStartDate3))); collection.Add(new JsonStringValue("ReduceEndDate3", ParseStringForDate(bc.Entity.ReduceEndDate3))); collection.Add(new JsonStringValue("ReduceStartDate4", ParseStringForDate(bc.Entity.ReduceStartDate4))); collection.Add(new JsonStringValue("ContractLatefeeRate", bc.Entity.ContractLatefeeRate.ToString("0.####"))); collection.Add(new JsonStringValue("RMRentalDeposit", bc.Entity.RMRentalDeposit.ToString("0.####"))); collection.Add(new JsonStringValue("RMUtilityDeposit", bc.Entity.RMUtilityDeposit.ToString("0.####"))); collection.Add(new JsonStringValue("PropertyFeeStartDate", ParseStringForDate(bc.Entity.PropertyFeeStartDate))); collection.Add(new JsonStringValue("PropertyFeeReduceStartDate", ParseStringForDate(bc.Entity.PropertyFeeReduceStartDate))); collection.Add(new JsonStringValue("PropertyFeeReduceEndDate", ParseStringForDate(bc.Entity.PropertyFeeReduceEndDate))); collection.Add(new JsonStringValue("WaterUnitPrice", bc.Entity.WaterUnitPrice.ToString("0.####"))); collection.Add(new JsonStringValue("ElecticityUintPrice", bc.Entity.ElecticityUintPrice.ToString("0.####"))); collection.Add(new JsonStringValue("AirconUnitPrice", bc.Entity.AirconUnitPrice.ToString("0.####"))); collection.Add(new JsonStringValue("PropertyUnitPrice", bc.Entity.PropertyUnitPrice.ToString("0.####"))); collection.Add(new JsonStringValue("SharedWaterFee", bc.Entity.SharedWaterFee.ToString("0.####"))); collection.Add(new JsonStringValue("SharedElectricyFee", bc.Entity.SharedElectricyFee.ToString("0.####"))); collection.Add(new JsonStringValue("WPRentalDeposit", bc.Entity.WPRentalDeposit.ToString("0.####"))); collection.Add(new JsonStringValue("WPUtilityDeposit", bc.Entity.WPUtilityDeposit.ToString("0.####"))); collection.Add(new JsonStringValue("WPQTY", bc.Entity.WPQTY.ToString())); collection.Add(new JsonStringValue("WPElectricyLimit", bc.Entity.WPElectricyLimit.ToString("0.####"))); collection.Add(new JsonStringValue("WPOverElectricyPrice", bc.Entity.WPOverElectricyPrice.ToString("0.####"))); collection.Add(new JsonStringValue("BBQTY", bc.Entity.BBQTY.ToString())); collection.Add(new JsonStringValue("BBAmount", bc.Entity.BBAmount.ToString("0.####"))); collection.Add(new JsonStringValue("IncreaseStartDate1", ParseStringForDate(bc.Entity.IncreaseStartDate1))); collection.Add(new JsonStringValue("IncreaseRate1", bc.Entity.IncreaseRate1.ToString("0.####"))); collection.Add(new JsonStringValue("IncreaseStartDate2", ParseStringForDate(bc.Entity.IncreaseStartDate2))); collection.Add(new JsonStringValue("IncreaseRate2", bc.Entity.IncreaseRate2.ToString("0.####"))); collection.Add(new JsonStringValue("IncreaseStartDate3", ParseStringForDate(bc.Entity.IncreaseStartDate3))); collection.Add(new JsonStringValue("IncreaseRate3", bc.Entity.IncreaseRate3.ToString("0.####"))); collection.Add(new JsonStringValue("IncreaseStartDate4", ParseStringForDate(bc.Entity.IncreaseStartDate4))); collection.Add(new JsonStringValue("IncreaseRate4", bc.Entity.IncreaseRate4.ToString("0.####"))); collection.Add(new JsonStringValue("OffLeaseStatus", bc.Entity.OffLeaseStatus)); collection.Add(new JsonStringValue("OffLeaseApplyDate", ParseStringForDate(bc.Entity.OffLeaseApplyDate))); collection.Add(new JsonStringValue("OffLeaseScheduleDate", ParseStringForDate(bc.Entity.OffLeaseScheduleDate))); collection.Add(new JsonStringValue("OffLeaseActulDate", ParseStringForDate(bc.Entity.OffLeaseActulDate))); collection.Add(new JsonStringValue("OffLeaseReason", bc.Entity.OffLeaseReason)); collection.Add(new JsonStringValue("ContractCreator", bc.Entity.ContractCreator)); collection.Add(new JsonStringValue("ContractCreateDate", ParseStringForDate(bc.Entity.ContractCreateDate))); collection.Add(new JsonStringValue("ContractLastReviser", bc.Entity.ContractLastReviser)); collection.Add(new JsonStringValue("ContractLastReviseDate", ParseStringForDate(bc.Entity.ContractLastReviseDate))); collection.Add(new JsonStringValue("ContractStatus", bc.Entity.ContractStatusName)); collection.Add(new JsonStringValue("ContractAuditor", bc.Entity.ContractAuditor)); collection.Add(new JsonStringValue("ContractAuditDate", ParseStringForDate(bc.Entity.ContractAuditDate))); collection.Add(new JsonStringValue("ContractFinanceAuditor", bc.Entity.ContractFinanceAuditor)); collection.Add(new JsonStringValue("ContractFinanceAuditDate", ParseStringForDate(bc.Entity.ContractFinanceAuditDate))); collection.Add(new JsonStringValue("Remark", bc.Entity.Remark)); collection.Add(new JsonStringValue("ContractAttachment", bc.Entity.ContractAttachment)); string files = ""; foreach (string str in bc.Entity.ContractAttachment.Replace("<file>", "").Replace("</file>", "^").Split('^')) { if (str == "") { continue; } files += "<span style=\"margin-left:10px;\"><a href=\"..\\..\\upload\\" + str + "\">" + str + "</a> " + "<button id=\"" + getRandom() + "\" onclick=\"deletefile(this.id,'" + str + "')\">删除</button></span>"; } collection.Add(new JsonStringValue("files", files)); collection.Add(new JsonStringValue("itemlist4", createItemList4(bc.Entity.RowPointer, "view"))); } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "view")); collection.Add(new JsonStringValue("flag", flag)); return(collection.ToString()); }
private string createList(string ContractNo, string ContractNoManual, string ContractType, string ContractSPNo, string ContractCustNo, string MinContractSignedDate, string MaxContractSignedDate, string MinContractEndDate, string MaxContractEndDate, string OffLeaseStatus, string MinOffLeaseActulDate, string MaxOffLeaseActulDate, 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=\"4%\">序号</th>"); sb.Append("<th width='6%'>合同类型</th>"); sb.Append("<th width='7%'>合同编号</th>"); sb.Append("<th width='9%'>手工合同编号</th>"); sb.Append("<th width='13%'>客户名称</th>"); sb.Append("<th width='8%'>合同签订日期</th>"); sb.Append("<th width='8%'>合同生效日期</th>"); sb.Append("<th width='8%'>合同到期日期</th>"); sb.Append("<th width='5%'>合同状态</th>"); sb.Append("<th width='6%'>退租处理状态</th>"); sb.Append("<th width='8%'>预约退租日期</th>"); sb.Append("<th width='8%'>实际退租日期</th>"); sb.Append("<th width='10%'>退租原因</th>"); sb.Append("</tr>"); sb.Append("</thead>"); int r = 1; sb.Append("<tbody>"); Business.Op.BusinessContract bc = new project.Business.Op.BusinessContract(); foreach (Entity.Op.EntityContract it in bc.GetRefundListQuery(ContractNo, ContractNoManual, ContractType, ContractSPNo, ContractCustNo, ParseSearchDateForString(MinContractSignedDate), ParseSearchDateForString(MaxContractSignedDate), ParseSearchDateForString(MinContractEndDate), ParseSearchDateForString(MaxContractEndDate), OffLeaseStatus, ParseSearchDateForString(MinOffLeaseActulDate), ParseSearchDateForString(MaxOffLeaseActulDate), page, pageSize)) { sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">"); sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>"); sb.Append("<td>" + it.ContractTypeName + "</td>"); sb.Append("<td>" + it.ContractNo + "</td>"); sb.Append("<td>" + it.ContractNoManual + "</td>"); sb.Append("<td>" + it.ContractCustName + "</td>"); sb.Append("<td>" + ParseStringForDate(it.ContractSignedDate) + "</td>"); sb.Append("<td>" + ParseStringForDate(it.ContractStartDate) + "</td>"); sb.Append("<td>" + ParseStringForDate(it.ContractEndDate) + "</td>"); if (it.ContractStatus == "1") { sb.Append("<td><label style=\"color:red;\">" + it.ContractStatusName + "</span></td>"); } else if (it.ContractStatus == "2") { sb.Append("<td><label style=\"color:blue;\">" + it.ContractStatusName + "</span></td>"); } else { sb.Append("<td><label style=\"color:gray;\">" + it.ContractStatusName + "</span></td>"); } sb.Append("<td><span class=\"label " + (it.OffLeaseStatus == "1" ? "label-success" : "") + " radius\">" + it.OffLeaseStatusName + "</span></td>"); sb.Append("<td>" + ParseStringForDate(it.OffLeaseScheduleDate) + "</td>"); sb.Append("<td>" + ParseStringForDate(it.OffLeaseActulDate) + "</td>"); sb.Append("<td>" + it.OffLeaseReason + "</td>"); sb.Append("</tr>"); r++; } sb.Append("</tbody>"); sb.Append("</table>"); sb.Append(Paginat(bc.GetRefundListCount(ContractNo, ContractNoManual, ContractType, ContractSPNo, ContractCustNo, ParseSearchDateForString(MinContractSignedDate), ParseSearchDateForString(MaxContractSignedDate), ParseSearchDateForString(MinContractEndDate), ParseSearchDateForString(MaxContractEndDate), OffLeaseStatus, ParseSearchDateForString(MinOffLeaseActulDate), ParseSearchDateForString(MaxOffLeaseActulDate)), pageSize, page, 7)); return(sb.ToString()); }