using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using POSV.Entity;
using POSV.ShoppingCart;
using POSV.Utils;
namespace POSV.WaiMai
{
public class DeliveryUtils
{
///
/// 根据电话号码获取熟客信息和最新的配送地址
///
///
///
public static Tuple , List> GetVisitor(string telephone)
{
Visitor visitor = null;
List address = null;
List tags = null;
using (var db = Global.Instance.OpenDataBase)
{
visitor = db.FirstOrDefault("where tel = @0" , telephone);
if (visitor != null)
{
address = db.Query("where visitorId = @0 order by createDate desc" , visitor.Id).ToList();
tags = db.Query("where visitorId = @0 order by createDate desc" , visitor.Id).ToList();
}
else
{
address = new List();
tags = new List();
}
}
return new Tuple , List>(visitor , address , tags);
}
}
}