public JsonResult Order_Deletes(string str) { BLL.OrderInfoBLL _BLL = new OrderInfoBLL(); retValue ret = new retValue(); string content = string.Empty; DataTable dt = str.ToTable(); string ids = ""; string costs = ""; foreach (DataRow item in dt.Rows) { if (!string.IsNullOrEmpty(item["ID"]._ToStrTrim())) { ids += item["ID"]._ToStrTrim() + ","; costs += item["CostID"]._ToStrTrim() + ","; } } ret = _BLL.DeleteByPK(ids.Remove(ids.Length - 1)); if (ret.result) { CostBLL costBLL = new CostBLL(); costBLL.DeleteByPK(costs); } content = ret.toJson(); var js = JsonConvert.SerializeObject(ret); return(Json(js, JsonRequestBehavior.AllowGet)); }