using com.hnshituo.core.webapp.vo;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class MeterBaseAddWeightService
    {
        public RESTfulResult<DataTable> doQueryWf(CommonPage<MeterBaseAddWeight> cp)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterBaseAddWeight>> rm = db.doOption<List<MeterBaseAddWeight>>("meterbaseaddweights", "doQueryWf", new object[] { cp }, 1);
            RESTfulResult<DataTable> result = new RESTfulResult<DataTable>();
            result.Succeed = rm.Succeed;
            result.Status = rm.Status;
            result.Message = rm.Message;
            result.ResultMessage = rm.ResultMessage;
            result.Code = rm.Code;

            if (rm.Succeed && rm.Data != null && rm.Data.Count > 0)
            {
                result.Data = rm.Data.ListToDataTable();
            }
            else
            {
                result.Data = new DataTable();
            }
            return result;
        }

    }
}
