public string GetExpenseMstInfo([FromUri] long id) { ExpenseAllModel ExpenseAll = new ExpenseAllModel(); ExpenseAll.ExpenseMst = ExpenseMstService.Find(id).Data; ExpenseAll.ExpenseDtls = ExpenseMstService.FindExpenseDtlByForeignKey(id).Data.ToList(); ExpenseAll.ExpenseHxs = ExpenseMstService.FindExpenseHxByForeignKey(id).Data.ToList(); //用款计划对应的附件 var qtAttachments = this.QtAttachmentService.Find(t => t.RelPhid == id && t.BTable == "YS3_EXPENSEMST").Data; if (qtAttachments != null && qtAttachments.Count > 0) { ExpenseAll.QtAttachments = qtAttachments.ToList(); } return(DataConverterHelper.SerializeObject(ExpenseAll)); }
/// <summary> /// 根据主键获取数据 /// </summary> /// <returns>返回Json串</returns> public string GetExpenseMstInfo() { long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键 string tabtype = System.Web.HttpContext.Current.Request.Params["tabtype"]; //Tab类型 switch (tabtype) { case "expensemst": var findedresultexpensemst = ExpenseMstService.Find(id); return(DataConverterHelper.ResponseResultToJson(findedresultexpensemst)); case "expensedtl": var findedresultexpensedtl = ExpenseMstService.FindExpenseDtlByForeignKey(id); return(DataConverterHelper.EntityListToJson(findedresultexpensedtl.Data, findedresultexpensedtl.Data.Count)); case "expensehx": var findedresultexpensehx = ExpenseMstService.FindExpenseHxByForeignKey(id); return(DataConverterHelper.EntityListToJson(findedresultexpensehx.Data, findedresultexpensehx.Data.Count)); default: FindedResult findedresultother = new FindedResult(); return(DataConverterHelper.ResponseResultToJson(findedresultother)); } }