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

namespace Common.DbOption.work
{
    public class MeterWorkPreWgttypeService
    {
        /// <summary>
        /// 根据预报编号查数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkPreWgttype>> doQueryWf(MeterWorkPreWgttype info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkPreWgttype>>> rm = db.doOption<PageList<List<MeterWorkPreWgttype>>>("meterworkprewgttypes", "/", new object[] { info }, 0);


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

            return result;
        }

        public RESTfulResult<MeterWorkPreWgttype> doAddWeightType(MeterWorkPreWgttype info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<MeterWorkPreWgttype> rm = db.doOption<MeterWorkPreWgttype>("meterworkprewgttypes", "/", new object[] { info }, 1);


            return rm;
        }
    }
}
