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(); } }
public EntityFieldDef AddEntityFieldDef(Guid entityDefId, string fieldName, string caption, DataTypes dataType, int length) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (entityDefId == Guid.Empty) { throw new ArgumentNullException("entityDefId"); } if (string.IsNullOrEmpty(fieldName)) { throw new ArgumentNullException("fieldName"); } EntityFieldDef result = null; try { DataModelContext.Initialize(RequestContext.Current.TenantId); result = MetadataLogic.AddEntityFieldDef(entityDefId, fieldName, caption, dataType, length); } finally { DataModelContext.Clear(); } return(result); }
public EntityDef[] GetEntityDefs() { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } EntityDef[] result = null; try { DataModelContext.Initialize(RequestContext.Current.TenantId); result = MetadataLogic.GetEntityDefs(); } finally { DataModelContext.Clear(); } return(result); }
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(); } }
public void UpdateEntityDef(Guid entityDefId, string caption) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (entityDefId == Guid.Empty) { throw new ArgumentNullException("entityDefId"); } try { DataModelContext.Initialize(RequestContext.Current.TenantId); MetadataLogic.UpdateEntityDef(entityDefId, caption); } finally { DataModelContext.Clear(); } }
public void DeleteEntityFieldDef(Guid fieldDefId) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (fieldDefId == Guid.Empty) { throw new ArgumentNullException("fieldDefId"); } try { DataModelContext.Initialize(RequestContext.Current.TenantId); MetadataLogic.DeleteEntityFieldDef(fieldDefId); } finally { DataModelContext.Clear(); } }
public EntityDef GetEnityDefByName(string name) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } EntityDef result = null; try { DataModelContext.Initialize(RequestContext.Current.TenantId); result = MetadataLogic.GetEnityDefByName(name); } finally { DataModelContext.Clear(); } return(result); }
public EntityFieldDef GetFieldDefById(Guid fieldId) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (fieldId == Guid.Empty) { throw new ArgumentNullException("fieldId"); } EntityFieldDef result = null; try { DataModelContext.Initialize(RequestContext.Current.TenantId); result = MetadataLogic.GetFieldDefById(fieldId); } finally { DataModelContext.Clear(); } return(result); }
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(); } }
public ShippingExportDC GetExportContractByNumber(string number) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (string.IsNullOrEmpty(number)) { throw new ArgumentNullException("number"); } try { DataModelContext.Initialize(RequestContext.Current.TenantId); return(ExportLogic.GetExportContractByNumber(RequestContext.Current.TenantId, number.Trim())); } catch (Exception ex) { throw new ExportContractExcepiton(ex.Message, ex); } finally { DataModelContext.Clear(); } }
public ShippingExportDC GetExportContractById(Guid id) { if (RequestContext.Current.TenantId == Guid.Empty) { throw new ArgumentNullException("tenantId"); } if (id == Guid.Empty) { throw new ArgumentNullException("id"); } try { DataModelContext.Initialize(RequestContext.Current.TenantId); return(ExportLogic.GetExportContractById(id)); } catch (Exception ex) { throw new ExportContractExcepiton(ex.Message, ex); } finally { DataModelContext.Clear(); } }
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(); } }