using com.hnshituo.core.webapp.vo;
using System.Collections.Generic;

namespace Common
{
    public class MeterWorkCarRecoverService
    {
        /// <summary>
        /// 查询复磅数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkCarRecover>> doQueryList(MeterWorkCarRecover info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkCarRecover>>> rm = db.doOption<PageList<List<MeterWorkCarRecover>>>("meterworkcarrecovers", "/", new object[] { info }, 0);

            RESTfulResult<List<MeterWorkCarRecover>> result = new RESTfulResult<List<MeterWorkCarRecover>>();
            result.Succeed = rm.Succeed;
            result.Status = rm.Status;
            result.Message = rm.Message;
            result.ResultMessage = rm.ResultMessage;
            result.Code = rm.Code;
            if (rm.Data != null && rm.Data.list != null && rm.Data.list.Count > 0)
            {
                result.Data = rm.Data.list;
            }

            return result;
        }

        /// <summary>
        /// 复磅操作：按客户端传入的值进行更新
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doRecover(MeterWorkCarRecover info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkcarrecovers", "doRecover", new object[] { info }, 1);
            return rm;
        }
    }
}