/// <summary> /// 根据主键获取数据 /// </summary> /// <returns>返回Json串</returns> public string GetSourceOfFundsInfo() { long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键 string tabtype = System.Web.HttpContext.Current.Request.Params["tabtype"]; //Tab类型 var findedresult = SourceOfFundsService.Find(id); return(DataConverterHelper.ResponseResultToJson(findedresult)); }
/// <summary> /// 删除数据 /// </summary> /// <returns>返回Json串</returns> public string Delete() { long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键 FindedResults <SourceOfFundsModel> sourceOfFunds = SourceOfFundsService.Find(t => t.PhId == id, ""); string DM = sourceOfFunds.Data[0].DM; FindedResults <BudgetDtlBudgetDtlModel> findedResults = BudgetMstService.FindBudgeAccountByZJDM(DM); FindedResults <ProjectDtlBudgetDtlModel> findedResults2 = ProjectMstService.FindProjectDtlBudgetDtlMstByZJDM(DM); if (findedResults.Data.Count > 0 || findedResults2.Data.Count > 0) { findedResults.Status = "failure"; findedResults.Msg = "当前资金来源已被引用,无法删除!"; return(DataConverterHelper.SerializeObject(findedResults)); } var deletedresult = SourceOfFundsService.Delete <System.Int64>(id); return(DataConverterHelper.SerializeObject(deletedresult)); }