/// <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 GetSourceOfFundsList() { string clientJsonQuery = System.Web.HttpContext.Current.Request.Params["queryfilter"]; //查询条件 Dictionary <string, object> dicWhere = DataConverterHelper.ConvertToDic(clientJsonQuery); //查询条件转Dictionary DataStoreParam storeparam = this.GetDataStoreParam(); var result = SourceOfFundsService.LoadWithPage(storeparam.PageIndex, storeparam.PageSize, dicWhere); return(DataConverterHelper.EntityListToJson <SourceOfFundsModel>(result.Results, (Int32)result.TotalItems)); }
/// <summary> /// 保存数据 /// </summary> /// <returns>返回Json串</returns> public string Save() { string mstformData = System.Web.HttpContext.Current.Request.Form["mstformData"]; var mstforminfo = DataConverterHelper.JsonToEntity <SourceOfFundsModel>(mstformData); List <SourceOfFundsModel> sourceOfFunds = mstforminfo.AllRow; for (int i = 0; i < sourceOfFunds.Count; i++) { sourceOfFunds[i].DM = sourceOfFunds[i].DM.Replace(" ", ""); sourceOfFunds[i].MC = sourceOfFunds[i].MC.Trim(); sourceOfFunds[i].BZ = sourceOfFunds[i].BZ.Trim(); } var savedresult = SourceOfFundsService.Save <Int64>(sourceOfFunds, ""); return(DataConverterHelper.SerializeObject(savedresult)); }
/// <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)); }
/// <summary> /// 根据code判断是否是末级 /// </summary> /// <returns>返回Json串</returns> public string IfLastStage(string Code) { var findResult = SourceOfFundsService.IfLastStage(Code); return(DataConverterHelper.SerializeObject(findResult)); }