private string detailaction(JsonArrayParse jp) { System.Text.StringBuilder sb = new System.Text.StringBuilder(""); JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Order.BusinessWorkOrderFee bc = new project.Business.Order.BusinessWorkOrderFee(); bc.load(jp.getValue("id"), user.Entity.AccID); 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='15%'>填写人</th>"); sb.Append("<th width='16%'>收款项目</th>"); sb.Append("<th width='30%'>说明</th>"); sb.Append("<th width='16%'>收款金额</th>"); sb.Append("<th width='18%'>操作</th>"); sb.Append("</tr>"); sb.Append("</thead>"); int r = 1; sb.Append("<tbody>"); Business.Order.BusinessWorkOrderFeeDetail bc1 = new project.Business.Order.BusinessWorkOrderFeeDetail(); foreach (Entity.Order.EntityWorkOrderFeeDetail it in bc1.GetWorkOrderFeeDetailQuery(user.Entity.AccID, bc.Entity.FeeNo, bc.Entity.OrderNo, string.Empty, string.Empty, default(DateTime), default(DateTime))) { sb.Append("<tr class=\"text-c\" id=\"" + it.InnerEntityOID + "\">"); sb.Append("<td align='center'>" + r.ToString() + "</td>"); sb.Append("<td>" + it.UserName + "</td>"); sb.Append("<td>" + it.FeeTypeName + "</td>"); if (bc.Entity.Status == "OPEN") { sb.Append("<td><input type=\"text\" class=\"input-text size-S\" style=\"width:100%\" placeholder=\"\" id=\"Cont" + it.InnerEntityOID + "\" value=\"" + it.Context + "\"></td>"); sb.Append("<td><input type=\"text\" class=\"input-text size-S\" style=\"width:100%\" placeholder=\"\" onblur=\"validDecimal(this.id)\" id=\"Amt" + it.InnerEntityOID + "\" value=\"" + it.FeeAmount.ToString("0.##") + "\"></td>"); sb.Append("<td><a href=\"javascript:;\" onclick=\"save('" + it.InnerEntityOID + "')\" class=\"btn btn-primary radius\"><i class=\"Hui-iconfont\"></i> 保存</a></td>"); } else { sb.Append("<td>" + it.Context + "</td>"); sb.Append("<td>" + it.FeeAmount.ToString("0.##") + "</td>"); sb.Append("<td></td>"); } sb.Append("</tr>"); r++; } sb.Append("</tbody>"); sb.Append("</table>"); collection.Add(new JsonStringValue("liststr", sb.ToString())); } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "detail")); collection.Add(new JsonStringValue("flag", flag)); return(collection.ToString()); }
private string approveaction(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Order.BusinessWorkOrderFee bc = new project.Business.Order.BusinessWorkOrderFee(); bc.load(jp.getValue("id"), user.Entity.AccID); if (bc.Entity.Status.ToUpper() == "CONFIRM") { flag = "3"; } else { if (bc.Entity.Status == "OPEN") { bc.Entity.Status = "APPROVE"; } else { bc.Entity.Status = "OPEN"; } int row = bc.Save(); if (row <= 0) { flag = "2"; } else { collection.Add(new JsonStringValue("liststr", createList(jp.getValue("OrderNo"), jp.getValue("Status"), jp.getValue("MinFeeDate"), jp.getValue("MaxFeeDate"), int.Parse(jp.getValue("page"))))); } } } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "approve")); collection.Add(new JsonStringValue("flag", flag)); return(collection.ToString()); }
private string saveaction(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Order.BusinessWorkOrderFee bc = new project.Business.Order.BusinessWorkOrderFee(); bc.load(jp.getValue("id"), user.Entity.AccID); if (bc.Entity.Status.ToUpper() != "OPEN") { flag = "3"; } else { Business.Order.BusinessWorkOrderFeeDetail detail = new Business.Order.BusinessWorkOrderFeeDetail(); detail.load(jp.getValue("detailid"), user.Entity.AccID); detail.Entity.Context = jp.getValue("Context"); detail.Entity.FeeAmount = ParseDecimalForString(jp.getValue("Amount")); detail.Entity.UpdateDate = GetDate(); detail.Entity.UpdateUser = user.Entity.UserNo; int row = detail.Save(); if (row <= 0) { flag = "2"; } else { obj.ExecuteNonQuery("update WO_WorkOrder_Fee set FeeAmount = isnull((select SUM(FeeAmount) from WO_WorkOrder_Fee_Detail where FeeNo='" + bc.Entity.FeeNo + "'),0) " + "where FeeNo = '" + bc.Entity.FeeNo + "'"); } } } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "save")); collection.Add(new JsonStringValue("flag", flag)); return(collection.ToString()); }