本文整理汇总了C#中YellowstonePathology.Add方法的典型用法代码示例。如果您正苦于以下问题:C# YellowstonePathology.Add方法的具体用法?C# YellowstonePathology.Add怎么用?C# YellowstonePathology.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YellowstonePathology
的用法示例。
在下文中一共展示了YellowstonePathology.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAllSQLTables
public static void AddAllSQLTables(YellowstonePathology.Business.Mongo.TransferCollection transferCollection)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SELECT Table_Name, Column_Name " +
"FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE " +
"WHERE OBJECTPROPERTY(OBJECT_ID(constraint_name), 'IsPrimaryKey') = 1 " +
"AND table_name like 'tbl%'";
cmd.CommandType = CommandType.Text;
YellowstonePathology.Business.Mongo.Server server = new Business.Mongo.TestServer(Business.Mongo.TestServer.SQLTransferDatabasename);
using (SqlConnection cn = new SqlConnection(YellowstonePathology.Business.Properties.Settings.Default.CurrentConnectionString))
{
cn.Open();
cmd.Connection = cn;
using (SqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
YellowstonePathology.Business.Mongo.Transfer transfer = new Transfer();
transfer.ObjectId = BsonObjectId.GenerateNewId().ToString();
transfer.TableName = dr.GetString(0);
transfer.PrimaryKeyName = dr.GetString(1);
transferCollection.Add(transfer);
}
}
}
}
示例2: BuildClientOrderCollection
public static void BuildClientOrderCollection(SqlDataReader dr, YellowstonePathology.Business.ClientOrder.Model.ClientOrderCollection clientOrderCollection)
{
int clientOrderIdCount = 0;
while (dr.Read())
{
if (dr["ClientOrderIdCount"] != DBNull.Value)
{
clientOrderIdCount = Convert.ToInt32(dr["ClientOrderIdCount"].ToString());
}
}
for (int i = 0; i < clientOrderIdCount; i++)
{
dr.NextResult();
YellowstonePathology.Business.ClientOrder.Model.ClientOrder clientOrder = BuildClientOrder(dr);
dr.NextResult();
BuildClientOrderDetailCollection(clientOrder.ClientOrderDetailCollection, dr);
if (clientOrder.ClientOrderId != null)
{
clientOrderCollection.Add(clientOrder);
}
}
}
示例3: BuildClientOrderDetailCollection
public static void BuildClientOrderDetailCollection(YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetailCollection clientOrderDetailCollection, SqlDataReader dr)
{
int clientOrderDetailCount = 0;
while (dr.Read())
{
clientOrderDetailCount = Convert.ToInt32(dr["ClientOrderDetailCount"].ToString());
}
if (clientOrderDetailCount > 0)
{
for (int i = 0; i < clientOrderDetailCount; i++)
{
dr.NextResult();
string orderTypeCode = null;
while (dr.Read())
{
orderTypeCode = dr["OrderTypeCode"].ToString();
}
dr.NextResult();
YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetail = YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetailFactory.GetClientOrderDetail(orderTypeCode, Persistence.PersistenceModeEnum.UpdateChangedProperties);
while (dr.Read())
{
YellowstonePathology.Business.Persistence.SqlDataReaderPropertyWriter propertyWriter = new Persistence.SqlDataReaderPropertyWriter(clientOrderDetail, dr);
propertyWriter.WriteProperties();
clientOrderDetailCollection.Add(clientOrderDetail);
}
}
}
else
{
dr.NextResult();
dr.NextResult();
}
}