Exemplo n.º 1
0
        public static WX_UserLocation QueryByOpenId(string openId)
        {
            if (string.IsNullOrWhiteSpace(openId))
            {
                throw new ArgumentNullException("openId");
            }

            IWXUserLocation factory = WXUserLocationFactory.GetFactory();

            return(factory.QueryByOpenId(openId));
        }
Exemplo n.º 2
0
        public static bool AddOrUpdate(WX_UserLocation model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            IWXUserLocation factory = WXUserLocationFactory.GetFactory();
            WX_UserLocation old     = factory.QueryByOpenId(model.CompanyID, model.OpenId);

            if (old != null)
            {
                return(factory.Update(model));
            }
            return(factory.Create(model));
        }