using com.hnshituo.core.webapp.vo;
using System.Collections.Generic;

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

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

        /// <summary>
        /// 热送磅理论重量数据更新
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<string> doUpdateWf(List<MeterWorkStorageSingleWgt> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkstoragesinglewgts", "doUpdateWf", new object[] { lt }, 1);
            return rm;
        }
    }
}