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()); }