示例#1
0
        /// <summary>
        /// 根据主键获取数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string GetBudgetAccountsInfo()
        {
            long   id      = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键
            string tabtype = System.Web.HttpContext.Current.Request.Params["tabtype"];             //Tab类型

            var findedresult = BudgetAccountsService.Find(id);

            return(DataConverterHelper.ResponseResultToJson(findedresult));
        }
示例#2
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string Delete()
        {
            long id = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]);              //主表主键

            FindedResults <BudgetAccountsModel> budgetAccounts = BudgetAccountsService.Find(t => t.PhId == id, "");

            if (budgetAccounts != null && budgetAccounts.Data.Count > 0)
            {
                string kmdm = budgetAccounts.Data[0].KMDM;
                FindedResults <BudgetDtlBudgetDtlModel> findedResults = BudgetMstService.FindBudgeAccount(kmdm);
                if (findedResults != null && findedResults.Data.Count > 0)
                {
                    findedResults.Status = ResponseStatus.Error;
                    findedResults.Msg    = "当前科目已被引用,无法删除!";
                    return(DataConverterHelper.SerializeObject(findedResults));
                }
            }


            var deletedresult = BudgetAccountsService.Delete <System.Int64>(id);

            return(DataConverterHelper.SerializeObject(deletedresult));
        }