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 MeterWorkRailwayRecMainService
    {
        /// <summary>
        /// 新增到主表列车数据（无业务）
        /// </summary>
        /// <param name="info">MeterWorkCarActualFirst</param>
        /// <returns></returns>
        public RESTfulResult<string> doAdd(MeterWorkRailwayRecMain info)
        {
            DbHelper db = new DbHelper();

            RESTfulResult<string> rm = db.doOption<string>("meterworkrailwayrecmains", "/", 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 result;
        }

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

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