private string deleteaction(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Base.BusinessDict bc = new project.Business.Base.BusinessDict(); bc.load(jp.getValue("id"), type, user.Entity.AccID); if (type == "CustType") { if (obj.ExecuteDataSet("select 1 from Base_Cust_Info where CustType='" + bc.Entity.DictNo + "' and AccID='" + user.Entity.AccID + "'").Tables[0].Rows.Count > 0) { flag = "3"; } } if (flag == "1") { int r = bc.delete(); if (r <= 0) { flag = "2"; } } } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "delete")); collection.Add(new JsonStringValue("flag", flag)); collection.Add(new JsonStringValue("liststr", createList())); return(collection.ToString()); }
private string deleteaction(JsonArrayParse jp) { JsonObjectCollection collection = new JsonObjectCollection(); string flag = "1"; try { Business.Base.BusinessDict bc = new project.Business.Base.BusinessDict(); bc.load(jp.getValue("id"), user.Entity.AccID, jp.getValue("DictType")); int r = bc.delete(); if (r <= 0) { flag = "2"; } } catch { flag = "2"; } collection.Add(new JsonStringValue("type", "delete")); collection.Add(new JsonStringValue("flag", flag)); collection.Add(new JsonStringValue("liststr", createList(jp.getValue("DictType")))); return(collection.ToString()); }