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

namespace CarMeterSystem
{
    public class LoginCls
    {
        public bool LoginIn()
        {
            MeterBaseSpotInfoService service = new MeterBaseSpotInfoService();
            if (AppConfigCache.productType == "2" || AppConfigCache.productType == "0")
            {
                RESTfulResult<List<MeterBaseSpotInfo>> rm = service.doQueryWf(new MeterBaseSpotInfo { flatComputerIp = IpAddress.getIp, validFlag = "1" });
                if (rm.Succeed && rm.Data != null && rm.Data.Count > 0)
                {
                    PbCache.sportInfo = rm.Data[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            {
                RESTfulResult<List<MeterBaseSpotInfo>> rm = service.doQueryWf(new MeterBaseSpotInfo { flatComputerIp = IpAddress.getIp, validFlag = "1" });
                if (rm.Succeed && rm.Data != null && rm.Data.Count > 0)
                {
                    PbCache.sportInfo = rm.Data[0];
                    return true;
                }
                else
                {
                    return false;
                }
            }
           
        }
    }
}
