/// <summary> /// 删除数据 /// </summary> /// <returns>返回Json串</returns> public string Delete() { long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键 FindedResults <PaymentMethodModel> paymentMethods = PaymentMethodService.Find(t => t.PhId == id); if (paymentMethods != null && paymentMethods.Data.Count > 0) { string dm = paymentMethods.Data[0].Dm; FindedResults <ProjectDtlBudgetDtlModel> findedResults1 = ProjectMstService.FindPaymentMethod(dm); if (findedResults1 != null && findedResults1.Status == ResponseStatus.Error) { return(DataConverterHelper.SerializeObject(findedResults1)); } FindedResults <BudgetDtlBudgetDtlModel> findedResults2 = BudgetMstService.FindPaymentMethod(dm); if (findedResults2 != null && findedResults2.Status == ResponseStatus.Error) { return(DataConverterHelper.SerializeObject(findedResults2)); } } var deletedresult = PaymentMethodService.Delete <System.Int64>(id); return(DataConverterHelper.SerializeObject(deletedresult)); }
public void DeleteAllPaymentMethods() { var methods = PaymentMethodService.GetAll(); foreach (var method in methods) { PaymentMethodService.Delete(method); } }
public ActionResult Delete(PaymentMethodRowModel[] model) { foreach (var each in model) { var method = _paymentMethodService.Find(each.Id); _paymentMethodService.Delete(method); } return(AjaxForm().ReloadPage()); }