本文整理汇总了C#中Nettiers类的典型用法代码示例。如果您正苦于以下问题:C# Nettiers类的具体用法?C# Nettiers怎么用?C# Nettiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Nettiers类属于命名空间,在下文中一共展示了Nettiers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Convert
/// <summary>
/// Convert a nettiers collection to the ws proxy collection.
/// </summary>
public static Nettiers.AdventureWorks.Entities.ProductModel Convert(Nettiers.AdventureWorks.Entities.ProductModel outItem , WsProxy.ProductModel item)
{
if (item != null && outItem != null)
{
outItem.ProductModelId = item.ProductModelId;
outItem.Name = item.Name;
outItem.CatalogDescription = item.CatalogDescription;
outItem.Instructions = item.Instructions;
outItem.Rowguid = item.Rowguid;
outItem.ModifiedDate = item.ModifiedDate;
outItem.AcceptChanges();
}
return outItem;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:19,代码来源:WsProductModelProviderBase.generated.cs
示例2: Update
/// <summary>
/// Update an existing row in the datasource.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.StoreContact object to update.</param>
/// <remarks>
/// After updating the datasource, the Nettiers.AdventureWorks.Entities.StoreContact object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
/// <returns>Returns true if operation is successful.</returns>
/// <exception cref="System.Exception">The command could not be executed.</exception>
/// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
/// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.StoreContact entity)
{
SqlDatabase database = new SqlDatabase(this._connectionString);
DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Sales.usp_adwTiers_StoreContact_Update", _useStoredProcedure);
database.AddInParameter(commandWrapper, "@CustomerId", DbType.Int32, entity.CustomerId );
database.AddInParameter(commandWrapper, "@OriginalCustomerId", DbType.Int32, entity.OriginalCustomerId);
database.AddInParameter(commandWrapper, "@ContactId", DbType.Int32, entity.ContactId );
database.AddInParameter(commandWrapper, "@OriginalContactId", DbType.Int32, entity.OriginalContactId);
database.AddInParameter(commandWrapper, "@ContactTypeId", DbType.Int32, entity.ContactTypeId );
database.AddInParameter(commandWrapper, "@Rowguid", DbType.Guid, entity.Rowguid );
database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
int results = 0;
//Provider Data Requesting Command Event
OnDataRequesting(new CommandEventArgs(commandWrapper, "Update", entity));
if (transactionManager != null)
{
results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
}
else
{
results = Utility.ExecuteNonQuery(database,commandWrapper);
}
//Stop Tracking Now that it has been updated and persisted.
if (DataRepository.Provider.EnableEntityTracking)
EntityManager.StopTracking(entity.EntityTrackingKey);
entity.OriginalCustomerId = entity.CustomerId;
entity.OriginalContactId = entity.ContactId;
entity.AcceptChanges();
//Provider Data Requested Command Event
OnDataRequested(new CommandEventArgs(commandWrapper, "Update", entity));
return Convert.ToBoolean(results);
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:54,代码来源:SqlStoreContactProviderBase.generated.cs
示例3: Insert
/// <summary>
/// Inserts a Nettiers.AdventureWorks.Entities.TransactionHistory object into the datasource using a transaction.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.TransactionHistory object to insert.</param>
/// <remarks>
/// After inserting into the datasource, the Nettiers.AdventureWorks.Entities.TransactionHistory object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
/// <returns>Returns true if operation is successful.</returns>
/// <exception cref="System.Exception">The command could not be executed.</exception>
/// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
/// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.TransactionHistory entity)
{
SqlDatabase database = new SqlDatabase(this._connectionString);
DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Production.usp_adwTiers_TransactionHistory_Insert", _useStoredProcedure);
database.AddOutParameter(commandWrapper, "@TransactionId", DbType.Int32, 4);
database.AddInParameter(commandWrapper, "@ProductId", DbType.Int32, entity.ProductId );
database.AddInParameter(commandWrapper, "@ReferenceOrderId", DbType.Int32, entity.ReferenceOrderId );
database.AddInParameter(commandWrapper, "@ReferenceOrderLineId", DbType.Int32, entity.ReferenceOrderLineId );
database.AddInParameter(commandWrapper, "@TransactionDate", DbType.DateTime, entity.TransactionDate );
database.AddInParameter(commandWrapper, "@TransactionType", DbType.StringFixedLength, entity.TransactionType );
database.AddInParameter(commandWrapper, "@Quantity", DbType.Int32, entity.Quantity );
database.AddInParameter(commandWrapper, "@ActualCost", DbType.Currency, entity.ActualCost );
database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
int results = 0;
//Provider Data Requesting Command Event
OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
if (transactionManager != null)
{
results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
}
else
{
results = Utility.ExecuteNonQuery(database,commandWrapper);
}
object _transactionId = database.GetParameterValue(commandWrapper, "@TransactionId");
entity.TransactionId = (System.Int32)_transactionId;
entity.AcceptChanges();
//Provider Data Requested Command Event
OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));
return Convert.ToBoolean(results);
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:53,代码来源:SqlTransactionHistoryProviderBase.generated.cs
示例4: Convert
/// <summary>
/// Convert a collection from to a nettiers collection to a the ws proxy collection.
/// </summary>
public static WsProxy.ErrorLog[] Convert(Nettiers.AdventureWorks.Entities.TList<ErrorLog> items)
{
WsProxy.ErrorLog[] outItems = new WsProxy.ErrorLog[items.Count];
int count = 0;
foreach (Nettiers.AdventureWorks.Entities.ErrorLog item in items)
{
outItems[count++] = Convert(item);
}
return outItems;
}
开发者ID:netTiers,项目名称:netTiers,代码行数:14,代码来源:WsErrorLogProviderBase.generated.cs
示例5: Update
/// <summary>
/// Update an existing row in the datasource.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.ErrorLog object to update.</param>
/// <remarks></remarks>
/// <returns>Returns true if operation is successful.</returns>
public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.ErrorLog entity)
{
WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
proxy.Url = Url;
try
{
WsProxy.ErrorLog result = proxy.ErrorLogProvider_Update(Convert(entity));
Convert(entity, result);
entity.AcceptChanges();
return true;
}
catch(SoapException soex)
{
System.Diagnostics.Debug.WriteLine(soex);
throw soex;
}
catch(Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
throw ex;
}
}
开发者ID:netTiers,项目名称:netTiers,代码行数:30,代码来源:WsErrorLogProviderBase.generated.cs
示例6: Convert
/// <summary>
/// Convert a nettiers collection to the ws proxy collection.
/// </summary>
public static Nettiers.AdventureWorks.Entities.ProductReview Convert(Nettiers.AdventureWorks.Entities.ProductReview outItem , WsProxy.ProductReview item)
{
if (item != null && outItem != null)
{
outItem.ProductReviewId = item.ProductReviewId;
outItem.ProductId = item.ProductId;
outItem.ReviewerName = item.ReviewerName;
outItem.ReviewDate = item.ReviewDate;
outItem.EmailAddress = item.EmailAddress;
outItem.Rating = item.Rating;
outItem.Comments = item.Comments;
outItem.ModifiedDate = item.ModifiedDate;
outItem.AcceptChanges();
}
return outItem;
}
开发者ID:netTiers,项目名称:netTiers,代码行数:21,代码来源:WsProductReviewProviderBase.generated.cs
示例7: WorkOrderRoutingItem
/// <summary>
/// Initializes a new instance of the <see cref="T:WorkOrderRoutingItem"/> class.
/// </summary>
public WorkOrderRoutingItem(Nettiers.AdventureWorks.Entities.WorkOrderRouting entity)
: base()
{
_entity = entity;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:8,代码来源:WorkOrderRoutingRepeater.cs
示例8: Convert
/// <summary>
/// Convert a nettiers collection to the ws proxy collection.
/// </summary>
public static Nettiers.AdventureWorks.Entities.SalesOrderDetail Convert(Nettiers.AdventureWorks.Entities.SalesOrderDetail outItem , WsProxy.SalesOrderDetail item)
{
if (item != null && outItem != null)
{
outItem.SalesOrderId = item.SalesOrderId;
outItem.SalesOrderDetailId = item.SalesOrderDetailId;
outItem.CarrierTrackingNumber = item.CarrierTrackingNumber;
outItem.OrderQty = item.OrderQty;
outItem.ProductId = item.ProductId;
outItem.SpecialOfferId = item.SpecialOfferId;
outItem.UnitPrice = item.UnitPrice;
outItem.UnitPriceDiscount = item.UnitPriceDiscount;
outItem.LineTotal = item.LineTotal;
outItem.Rowguid = item.Rowguid;
outItem.ModifiedDate = item.ModifiedDate;
outItem.OriginalSalesOrderId = item.SalesOrderId;
outItem.AcceptChanges();
}
return outItem;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:25,代码来源:WsSalesOrderDetailProviderBase.generated.cs
示例9: Convert
/// <summary>
/// Convert a nettiers entity to the ws proxy entity.
/// </summary>
public static WsProxy.StateProvince Convert(Nettiers.AdventureWorks.Entities.StateProvince item)
{
WsProxy.StateProvince outItem = new WsProxy.StateProvince();
outItem.StateProvinceId = item.StateProvinceId;
outItem.StateProvinceCode = item.StateProvinceCode;
outItem.CountryRegionCode = item.CountryRegionCode;
outItem.IsOnlyStateProvinceFlag = item.IsOnlyStateProvinceFlag;
outItem.Name = item.Name;
outItem.TerritoryId = item.TerritoryId;
outItem.Rowguid = item.Rowguid;
outItem.ModifiedDate = item.ModifiedDate;
return outItem;
}
开发者ID:netTiers,项目名称:netTiers,代码行数:18,代码来源:WsStateProvinceProviderBase.generated.cs
示例10: SalesOrderHeaderSalesReasonItem
/// <summary>
/// Initializes a new instance of the <see cref="T:SalesOrderHeaderSalesReasonItem"/> class.
/// </summary>
public SalesOrderHeaderSalesReasonItem(Nettiers.AdventureWorks.Entities.SalesOrderHeaderSalesReason entity)
: base()
{
_entity = entity;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:8,代码来源:SalesOrderHeaderSalesReasonRepeater.cs
示例11: Update
/// <summary>
/// Update an existing row in the datasource.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.JobCandidate object to update.</param>
/// <remarks>
/// After updating the datasource, the Nettiers.AdventureWorks.Entities.JobCandidate object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
/// <returns>Returns true if operation is successful.</returns>
/// <exception cref="System.Exception">The command could not be executed.</exception>
/// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
/// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.JobCandidate entity)
{
SqlDatabase database = new SqlDatabase(this._connectionString);
DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "HumanResources.usp_adwTiers_JobCandidate_Update", _useStoredProcedure);
database.AddInParameter(commandWrapper, "@JobCandidateId", DbType.Int32, entity.JobCandidateId );
database.AddInParameter(commandWrapper, "@EmployeeId", DbType.Int32, (entity.EmployeeId.HasValue ? (object) entity.EmployeeId : System.DBNull.Value) );
database.AddInParameter(commandWrapper, "@Resume", DbType.Xml, entity.Resume );
database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
int results = 0;
//Provider Data Requesting Command Event
OnDataRequesting(new CommandEventArgs(commandWrapper, "Update", entity));
if (transactionManager != null)
{
results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
}
else
{
results = Utility.ExecuteNonQuery(database,commandWrapper);
}
//Stop Tracking Now that it has been updated and persisted.
if (DataRepository.Provider.EnableEntityTracking)
EntityManager.StopTracking(entity.EntityTrackingKey);
entity.AcceptChanges();
//Provider Data Requested Command Event
OnDataRequested(new CommandEventArgs(commandWrapper, "Update", entity));
return Convert.ToBoolean(results);
}
开发者ID:netTiers,项目名称:netTiers,代码行数:49,代码来源:SqlJobCandidateProviderBase.generated.cs
示例12: Insert
/// <summary>
/// Inserts a Nettiers.AdventureWorks.Entities.JobCandidate object into the datasource using a transaction.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.JobCandidate object to insert.</param>
/// <remarks>
/// After inserting into the datasource, the Nettiers.AdventureWorks.Entities.JobCandidate object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
/// <returns>Returns true if operation is successful.</returns>
/// <exception cref="System.Exception">The command could not be executed.</exception>
/// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
/// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.JobCandidate entity)
{
SqlDatabase database = new SqlDatabase(this._connectionString);
DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "HumanResources.usp_adwTiers_JobCandidate_Insert", _useStoredProcedure);
database.AddOutParameter(commandWrapper, "@JobCandidateId", DbType.Int32, 4);
database.AddInParameter(commandWrapper, "@EmployeeId", DbType.Int32, (entity.EmployeeId.HasValue ? (object) entity.EmployeeId : System.DBNull.Value));
database.AddInParameter(commandWrapper, "@Resume", DbType.Xml, entity.Resume );
database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
int results = 0;
//Provider Data Requesting Command Event
OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
if (transactionManager != null)
{
results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
}
else
{
results = Utility.ExecuteNonQuery(database,commandWrapper);
}
object _jobCandidateId = database.GetParameterValue(commandWrapper, "@JobCandidateId");
entity.JobCandidateId = (System.Int32)_jobCandidateId;
entity.AcceptChanges();
//Provider Data Requested Command Event
OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));
return Convert.ToBoolean(results);
}
开发者ID:netTiers,项目名称:netTiers,代码行数:48,代码来源:SqlJobCandidateProviderBase.generated.cs
示例13: Insert
/// <summary>
/// Inserts a Nettiers.AdventureWorks.Entities.ProductReview object into the datasource using a transaction.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.ProductReview object to insert.</param>
/// <remarks></remarks>
/// <returns>Returns true if operation is successful.</returns>
public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.ProductReview entity)
{
WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
proxy.Url = Url;
try
{
WsProxy.ProductReview result = proxy.ProductReviewProvider_Insert(Convert(entity));
Convert(entity, result);
return true;
}
catch(SoapException soex)
{
System.Diagnostics.Debug.WriteLine(soex);
throw soex;
}
catch(Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
throw ex;
}
}
开发者ID:netTiers,项目名称:netTiers,代码行数:29,代码来源:WsProductReviewProviderBase.generated.cs
示例14: ContactItem
/// <summary>
/// Initializes a new instance of the <see cref="T:ContactItem"/> class.
/// </summary>
public ContactItem(Nettiers.AdventureWorks.Entities.Contact entity)
: base()
{
_entity = entity;
}
开发者ID:netTiers,项目名称:netTiers,代码行数:8,代码来源:ContactRepeater.cs
示例15: VStateProvinceCountryRegionItem
/// <summary>
/// Initializes a new instance of the <see cref="T:VStateProvinceCountryRegionItem"/> class.
/// </summary>
public VStateProvinceCountryRegionItem(Nettiers.AdventureWorks.Entities.VStateProvinceCountryRegion entity)
: base()
{
_entity = entity;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:8,代码来源:VStateProvinceCountryRegionRepeater.cs
示例16: ProductReviewItem
/// <summary>
/// Initializes a new instance of the <see cref="T:ProductReviewItem"/> class.
/// </summary>
public ProductReviewItem(Nettiers.AdventureWorks.Entities.ProductReview entity)
: base()
{
_entity = entity;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:8,代码来源:ProductReviewRepeater.cs
示例17: BulkInsert
/// <summary>
/// Lets you efficiently bulk many entity to the database.
/// </summary>
/// <param name="transactionManager">NOTE: The transaction manager should be null for the web service client implementation.</param>
/// <param name="entityList">The entities.</param>
/// <remarks>
/// After inserting into the datasource, the Nettiers.AdventureWorks.Entities.ErrorLog object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
public override void BulkInsert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.TList<ErrorLog> entityList)
{
WsProxy.AdventureWorksServices proxy = new WsProxy.AdventureWorksServices();
proxy.Url = Url;
try
{
proxy.ErrorLogProvider_BulkInsert(Convert(entityList));
}
catch(SoapException soex)
{
System.Diagnostics.Debug.WriteLine(soex);
throw soex;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
throw ex;
}
}
开发者ID:netTiers,项目名称:netTiers,代码行数:28,代码来源:WsErrorLogProviderBase.generated.cs
示例18: Update
/// <summary>
/// Update an existing row in the datasource.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.UnitMeasure object to update.</param>
/// <remarks>
/// After updating the datasource, the Nettiers.AdventureWorks.Entities.UnitMeasure object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
/// <returns>Returns true if operation is successful.</returns>
/// <exception cref="System.Exception">The command could not be executed.</exception>
/// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
/// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
public override bool Update(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.UnitMeasure entity)
{
SqlDatabase database = new SqlDatabase(this._connectionString);
DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Production.usp_adwTiers_UnitMeasure_Update", _useStoredProcedure);
database.AddInParameter(commandWrapper, "@UnitMeasureCode", DbType.StringFixedLength, entity.UnitMeasureCode );
database.AddInParameter(commandWrapper, "@OriginalUnitMeasureCode", DbType.StringFixedLength, entity.OriginalUnitMeasureCode);
database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name );
database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
int results = 0;
//Provider Data Requesting Command Event
OnDataRequesting(new CommandEventArgs(commandWrapper, "Update", entity));
if (transactionManager != null)
{
results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
}
else
{
results = Utility.ExecuteNonQuery(database,commandWrapper);
}
//Stop Tracking Now that it has been updated and persisted.
if (DataRepository.Provider.EnableEntityTracking)
EntityManager.StopTracking(entity.EntityTrackingKey);
entity.OriginalUnitMeasureCode = entity.UnitMeasureCode;
entity.AcceptChanges();
//Provider Data Requested Command Event
OnDataRequested(new CommandEventArgs(commandWrapper, "Update", entity));
return Convert.ToBoolean(results);
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:50,代码来源:SqlUnitMeasureProviderBase.generated.cs
示例19: ScrapReasonItem
/// <summary>
/// Initializes a new instance of the <see cref="T:ScrapReasonItem"/> class.
/// </summary>
public ScrapReasonItem(Nettiers.AdventureWorks.Entities.ScrapReason entity)
: base()
{
_entity = entity;
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:8,代码来源:ScrapReasonRepeater.cs
示例20: Insert
/// <summary>
/// Inserts a Nettiers.AdventureWorks.Entities.StoreContact object into the datasource using a transaction.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="entity">Nettiers.AdventureWorks.Entities.StoreContact object to insert.</param>
/// <remarks>
/// After inserting into the datasource, the Nettiers.AdventureWorks.Entities.StoreContact object will be updated
/// to refelect any changes made by the datasource. (ie: identity or computed columns)
/// </remarks>
/// <returns>Returns true if operation is successful.</returns>
/// <exception cref="System.Exception">The command could not be executed.</exception>
/// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
/// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
public override bool Insert(TransactionManager transactionManager, Nettiers.AdventureWorks.Entities.StoreContact entity)
{
SqlDatabase database = new SqlDatabase(this._connectionString);
DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Sales.usp_adwTiers_StoreContact_Insert", _useStoredProcedure);
database.AddInParameter(commandWrapper, "@CustomerId", DbType.Int32, entity.CustomerId );
database.AddInParameter(commandWrapper, "@ContactId", DbType.Int32, entity.ContactId );
database.AddInParameter(commandWrapper, "@ContactTypeId", DbType.Int32, entity.ContactTypeId );
database.AddOutParameter(commandWrapper, "@Rowguid", DbType.Guid, 16);
database.AddInParameter(commandWrapper, "@ModifiedDate", DbType.DateTime, entity.ModifiedDate );
int results = 0;
//Provider Data Requesting Command Event
OnDataRequesting(new CommandEventArgs(commandWrapper, "Insert", entity));
if (transactionManager != null)
{
results = Utility.ExecuteNonQuery(transactionManager, commandWrapper);
}
else
{
results = Utility.ExecuteNonQuery(database,commandWrapper);
}
object _rowguid = database.GetParameterValue(commandWrapper, "@Rowguid");
entity.Rowguid = (System.Guid)_rowguid;
entity.OriginalCustomerId = entity.CustomerId;
entity.OriginalContactId = entity.ContactId;
entity.AcceptChanges();
//Provider Data Requested Command Event
OnDataRequested(new CommandEventArgs(commandWrapper, "Insert", entity));
return Convert.ToBoolean(results);
}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:51,代码来源:SqlStoreContactProviderBase.generated.cs
注:本文中的Nettiers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论