Exemple #1
0
        public OkObjectResult Put(string id, DateTime dTime, double dRmb, string sCode, string sDesc, string sOwner)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(JsonRes.Fail("id无效"));
            }
            VsLiquidityDetail pExist = _liquidityDetailService.QueryByID(id);

            if (pExist == null)
            {
                return(JsonRes.Fail("数据不存在"));
            }

            pExist.DTime  = dTime;
            pExist.FRmb   = dRmb;
            pExist.SCode  = sCode;
            pExist.SDesc  = sDesc;
            pExist.SOwner = sOwner;

            string error = "";
            int    res   = _liquidityDetailService.TryUpdate(out error, pExist);

            if (res == 0)
            {
                return(JsonRes.Fail(pExist, error));
            }
            return(JsonRes.Success(pExist));
        }
Exemple #2
0
        public OkObjectResult Post(DateTime dTime, double dRmb, string sCode, string sDesc, string sOwner)
        {
            VsLiquidityDetail entity = new VsLiquidityDetail
            {
                DTime  = dTime,
                FRmb   = dRmb,
                SCode  = sCode,
                SDesc  = sDesc,
                SOwner = sOwner,
            };
            string error = "";
            int    res   = _liquidityDetailService.TryAdd(out error, entity);

            if (res == 0)
            {
                return(JsonRes.Fail(entity, error));
            }
            return(JsonRes.Success(entity));
        }
Exemple #3
0
        public OkObjectResult Delete(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(JsonRes.Fail("id无效"));
            }
            VsLiquidityDetail pExist = _liquidityDetailService.QueryByID(id);

            if (pExist == null)
            {
                return(JsonRes.Fail("数据不存在"));
            }
            string error = "";
            int    res   = _liquidityDetailService.TryDelete(out error, pExist);

            if (res == 0)
            {
                return(JsonRes.Fail(pExist, error));
            }
            return(JsonRes.Success(pExist));
        }