Пример #1
0
 private static void SaveLocation(ReceiveMessage message)
 {
     using (WeixinDataSource source = new WeixinDataSource())
     using (UserLocationResolver resolver = new UserLocationResolver(source))
     {
         resolver.Insert(message);
     }
 }
 public override object Create(string key, params object[] args)
 {
     using (WeixinDataSource source = new WeixinDataSource())
     using (CacheDataResolver resolver = new CacheDataResolver(source))
     {
         return resolver.ReadObject(key);
     }
 }
        public override object Create(string key, params object[] args)
        {
            using (var source = new WeixinDataSource())
            using (var resolver = new MediaCacheResolver(source))
            {
                MediaType type = (MediaType)args[0];
                string path = args[1].Convert<string>();

                return resolver.GetWeixinMediaId(type, path);
            }
        }
Пример #4
0
 public void Log(ReceiveMessage message)
 {
     using (WeixinDataSource source = new WeixinDataSource())
     using (MessageResolver resolver = new MessageResolver(source))
     {
         resolver.SetCommands(AdapterCommand.Insert);
         DataRow row = resolver.NewRow();
         message.AddToDataRow(row);
         row["CreateDate"] = message.CreateTime;
         resolver.UpdateDatabase();
     }
 }
Пример #5
0
 public void Log(ReceiveMessage message)
 {
     using (WeixinDataSource source = new WeixinDataSource())
         using (MessageResolver resolver = new MessageResolver(source))
         {
             resolver.SetCommands(AdapterCommand.Insert);
             DataRow row = resolver.NewRow();
             message.AddToDataRow(row);
             row["CreateDate"] = message.CreateTime;
             resolver.UpdateDatabase();
         }
 }