コード例 #1
0
ファイル: ExportService.cs プロジェクト: penzhaohui/Crab
 public Guid CreateExportContract(string number, Guid creator)
 {
     if (RequestContext.Current.TenantId == Guid.Empty)
     {
         throw new ArgumentNullException("tenantId");
     }
     if (number == null || string.IsNullOrEmpty(number.Trim()))
     {
         throw new ArgumentNullException("number");
     }
     if (creator == Guid.Empty)
     {
         throw new ArgumentNullException("creator");
     }
     try
     {
         DataModelContext.Initialize(RequestContext.Current.TenantId);
         return(ExportLogic.CreateExportContract(RequestContext.Current.TenantId, number.Trim(), creator));
     }
     catch (Exception ex)
     {
         throw new ExportContractExcepiton(ex.Message, ex);
     }
     finally
     {
         DataModelContext.Clear();
     }
 }
コード例 #2
0
ファイル: ExportService.cs プロジェクト: penzhaohui/Crab
 public void DeleteExportContract(Guid id)
 {
     if (RequestContext.Current.TenantId == Guid.Empty)
     {
         throw new ArgumentNullException("tenantId");
     }
     try
     {
         DataModelContext.Initialize(RequestContext.Current.TenantId);
         ExportLogic.DeleteExportContract(id);
     }
     catch (Exception ex)
     {
         throw new ExportContractExcepiton(ex.Message, ex);
     }
     finally
     {
         DataModelContext.Clear();
     }
 }
コード例 #3
0
ファイル: ExportService.cs プロジェクト: penzhaohui/Crab
 public ShippingExportDC[] FindExportContractList(string numberToMatch, int?status, Guid?owner)
 {
     if (RequestContext.Current.TenantId == Guid.Empty)
     {
         throw new ArgumentNullException("tenantId");
     }
     try
     {
         DataModelContext.Initialize(RequestContext.Current.TenantId);
         return(ExportLogic.FindExportContractList(
                    RequestContext.Current.TenantId,
                    numberToMatch != null?numberToMatch.Trim():string.Empty,
                    status, owner));
     }
     catch (Exception ex)
     {
         throw new ExportContractExcepiton(ex.Message, ex);
     }
     finally
     {
         DataModelContext.Clear();
     }
 }
コード例 #4
0
ファイル: ExportService.cs プロジェクト: penzhaohui/Crab
 public void UpdateExportContract(ShippingExportDC contract)
 {
     if (RequestContext.Current.TenantId == Guid.Empty)
     {
         throw new ArgumentNullException("tenantId");
     }
     if (contract == null || contract.Id == Guid.Empty)
     {
         throw new ArgumentNullException("contract");
     }
     try
     {
         DataModelContext.Initialize(RequestContext.Current.TenantId);
         ExportLogic.UpdateExportContract(contract);
     }
     catch (Exception ex)
     {
         throw new ExportContractExcepiton(ex.Message, ex);
     }
     finally
     {
         DataModelContext.Clear();
     }
 }