/// <summary>
 /// 上传本地数据服务类
 /// </summary>
 /// <param name="repoUri">本地数据库</param>
 /// <param name="databaseUri">上传到的数据库</param>
 public LDB_UpdateLoaclDataService(string repoUri, string databaseUri)
 {
     _Provider            = LDB_ProviderFactory.Create <LDB_ICardPaymentRecordProvider>(repoUri);
     _CardPaymentProvider = ProviderFactory.Create <ICardPaymentRecordProvider>(databaseUri);
     _DataBaseUri         = databaseUri;
     _UpdateInterval      = 5;
 }
Exemple #2
0
 /// <summary>
 ///使用事物保存到数据库,使用事物是为了访问数据库的次数,多次访问数据会导致操作时间过长
 /// </summary>
 /// <param name="info"></param>
 public void SaveSettingWithUnitWork <T>(T info) where T : class
 {
     try
     {
         Type t = typeof(T);
         LDB_SysparameterInfo para;
         if (info != null)
         {
             DataContractSerializer ser = new DataContractSerializer(t);
             using (MemoryStream stream = new MemoryStream())
             {
                 ser.WriteObject(stream, info);
                 stream.Position = 0;
                 byte[] data = new byte[stream.Length];
                 stream.Read(data, 0, (int)stream.Length);
                 string value = Encoding.UTF8.GetString(data);
                 para = new LDB_SysparameterInfo(t.Name, value, string.Empty);
             }
         }
         else
         {
             para = new LDB_SysparameterInfo(t.Name, string.Empty, string.Empty);
         }
         LDB_ISysParameterProvider provider = LDB_ProviderFactory.Create <LDB_ISysParameterProvider>(_RepoUri);
         provider.Insert(para, unitWork);
     }
     catch (Exception ex)
     {
         ExceptionPolicy.HandleException(ex);
     }
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="repoUri">存储层的资源标识(可以是数据库连接字符串或文件名等,根据存储层的不同可以设置不同的值)</param>
 public LDB_CardPaymentRecordBll(string repoUri)
 {
     _RepoUri  = repoUri;
     _Provider = LDB_ProviderFactory.Create <LDB_ICardPaymentRecordProvider>(repoUri);
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="repoUri">存储层的资源标识(可以是数据库连接字符串或文件名等,根据存储层的不同可以设置不同的值)</param>
 public LDB_SystemParameterBll(string repoUri)
 {
     provider = LDB_ProviderFactory.Create <LDB_ISysParameterProvider>(repoUri);
 }