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

namespace Common.DbOption.work
{
    public class MeterWorkRailwayReceivedService
    {
        /// <summary>
        /// 新增到从表列车数据（无业务）
        /// </summary>
        /// <param name="info">MeterWorkCarActualFirst</param>
        /// <returns></returns>
        public RESTfulResult<string> doAdd(MeterWorkRailwayMotorialReceived info)
        {
            DbHelper db = new DbHelper();

            RESTfulResult<string> rm = db.doOption<string>("meterworkrailwayreceiveds", "/", new object[] { info }, 1);
            RESTfulResult<string> result = new RESTfulResult<string>();
            result.Succeed = rm.Succeed;
            result.Status = rm.Status;
            result.Message = rm.Message;
            result.ResultMessage = rm.ResultMessage;
            result.Code = rm.Code;
            result.Data = rm.Data;
            return rm;
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="info">MeterWorkRailwayMotorialReceived</param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkRailwayMotorialReceived>> Query(Hashtable info)
        {
            DbHelper db = new DbHelper();

            RESTfulResult<PageList<List<MeterWorkRailwayMotorialReceived>>> rm = db.doOption<PageList<List<MeterWorkRailwayMotorialReceived>>>("meterworkrailwayreceiveds", "/listLikePost/", new object[] { info }, 1);
            RESTfulResult<List<MeterWorkRailwayMotorialReceived>> result = new RESTfulResult<List<MeterWorkRailwayMotorialReceived>>();
            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;
        }
    }
}
