Ejemplo n.º 1
0
        /// <summary>
        /// 根据主键获取数据
        /// </summary>
        /// <returns>返回Json串</returns>
        public string GetPerformEvalTargetInfo()
        {
            long   id           = Convert.ToInt64(System.Web.HttpContext.Current.Request.Params["id"]); //主表主键
            string tabtype      = System.Web.HttpContext.Current.Request.Params["tabtype"];             //Tab类型
            var    findedresult = PerformEvalTargetService.Find(id);

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

            FindedResults <PerformEvalTargetModel> performEvalTarget = PerformEvalTargetService.Find(t => t.PhId == id, "");
            string FTargetCode = performEvalTarget.Data[0].FTargetCode;
            FindedResults <ProjectDtlPerformTargetModel> findedResults = ProjectMstService.FindProjectDtlPerformTargetByFTargetCode(FTargetCode);

            if (findedResults != null && findedResults.Data.Count > 0)
            {
                findedResults.Status = "failure";
                findedResults.Msg    = "当前指标已被引用,无法删除!";
                return(DataConverterHelper.SerializeObject(findedResults));
            }

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

            return(DataConverterHelper.SerializeObject(deletedresult));
        }