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

namespace Common
{

    /// <summary>
    /// 皮带秤校皮数据接口
    /// </summary>
    public class MeterWorkBeltXiaopiService
    {
        /// <summary>
        /// 数据查询：查询旧零点
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltXiaopi>> doQueryWf(CommonPage<MeterWorkBeltXiaopi> info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltXiaopi>> rm = db.doOption<List<MeterWorkBeltXiaopi>>("meterworkbeltxiaopis", "doQueryWf", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 数据查询，平台默认方法
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltXiaopi>> doQuery(MeterWorkBeltXiaopi info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkBeltXiaopi>>> rm = db.doOption<PageList<List<MeterWorkBeltXiaopi>>>("meterworkbeltxiaopis", "/", new object[] { info }, 0);

            RESTfulResult<List<MeterWorkBeltXiaopi>> result = new RESTfulResult<List<MeterWorkBeltXiaopi>>();
            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> doAddWf(MeterWorkBeltXiaopi info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkbeltxiaopis", "doAddWf", new object[] { info }, 1);
            return rm;
        }


    }
}
