本文整理汇总了C#中Csla.Data.SafeDataReader.GetSmartDate方法的典型用法代码示例。如果您正苦于以下问题:C# SafeDataReader.GetSmartDate方法的具体用法?C# SafeDataReader.GetSmartDate怎么用?C# SafeDataReader.GetSmartDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Csla.Data.SafeDataReader
的用法示例。
在下文中一共展示了SafeDataReader.GetSmartDate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fetch
public VoucherEditDto Fetch(int id)
{
var voucherEdit = new VoucherEditDto();
using (var ctx = ConnectionManager<SqlConnection>.GetManager("CoopCheck"))
{
using (var cmd = new SqlCommand("dbo.dsa_GetVoucher", ctx.Connection))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@tran_id", id).DbType = DbType.Int32;
var dr = new SafeDataReader(cmd.ExecuteReader());
dr.Read();
voucherEdit.Id = dr.GetInt32("tran_id");
voucherEdit.Amount = (Decimal?)dr.GetValue("tran_amount");
voucherEdit.PersonId = !dr.IsDBNull("person_id") ? dr.GetString("person_id") : null;
voucherEdit.NamePrefix = !dr.IsDBNull("name_prefix") ? dr.GetString("name_prefix") : null;
voucherEdit.First = !dr.IsDBNull("first_name") ? dr.GetString("first_name") : null;
voucherEdit.Middle = !dr.IsDBNull("middle_name") ? dr.GetString("middle_name") : null;
voucherEdit.Last = !dr.IsDBNull("last_name") ? dr.GetString("last_name") : null;
voucherEdit.Suffix = !dr.IsDBNull("name_suffix") ? dr.GetString("name_suffix") : null;
voucherEdit.Title = !dr.IsDBNull("title") ? dr.GetString("title") : null;
voucherEdit.Company = !dr.IsDBNull("company") ? dr.GetString("company") : null;
voucherEdit.AddressLine1 = !dr.IsDBNull("address_1") ? dr.GetString("address_1") : null;
voucherEdit.AddressLine2 = !dr.IsDBNull("address_2") ? dr.GetString("address_2") : null;
voucherEdit.Municipality = !dr.IsDBNull("municipality") ? dr.GetString("municipality") : null;
voucherEdit.Region = !dr.IsDBNull("region") ? dr.GetString("region") : null;
voucherEdit.PostalCode = !dr.IsDBNull("postal_code") ? dr.GetString("postal_code") : null;
voucherEdit.Country = !dr.IsDBNull("country") ? dr.GetString("country") : null;
voucherEdit.PhoneNumber = !dr.IsDBNull("phone_number") ? dr.GetString("phone_number") : null;
voucherEdit.EmailAddress = !dr.IsDBNull("email") ? dr.GetString("email") : null;
voucherEdit.Updated = !dr.IsDBNull("updated") ? dr.GetSmartDate("updated", true) : null;
}
}
return voucherEdit;
}
示例2: Fetch
private BatchEditDto Fetch(IDataReader data)
{
var batchEdit = new BatchEditDto();
using (var dr = new SafeDataReader(data))
{
if (dr.Read())
{
batchEdit.Num = dr.GetInt32("batch_num");
batchEdit.Date = !dr.IsDBNull("batch_date") ? dr.GetSmartDate("batch_date", true) : null;
batchEdit.PayDate = !dr.IsDBNull("pay_date") ? dr.GetSmartDate("pay_date", true) : null;
batchEdit.Amount = (Decimal?)dr.GetValue("batch_amount");
batchEdit.JobNum = (int?)dr.GetValue("job_num");
batchEdit.Description = !dr.IsDBNull("batch_dscr") ? dr.GetString("batch_dscr") : null;
batchEdit.Updated = !dr.IsDBNull("updated") ? dr.GetSmartDate("updated", true) : null;
batchEdit.ThankYou1 = !dr.IsDBNull("thank_you_1") ? dr.GetString("thank_you_1") : null;
batchEdit.StudyTopic = !dr.IsDBNull("study_topic") ? dr.GetString("study_topic") : null;
batchEdit.ThankYou2 = !dr.IsDBNull("thank_you_2") ? dr.GetString("thank_you_2") : null;
batchEdit.MarketingResearchMessage = !dr.IsDBNull("marketing_research_message") ? dr.GetString("marketing_research_message") : null;
}
FetchChildren(dr);
}
return batchEdit;
}
示例3: Fetch
private AccountDto Fetch(IDataReader data)
{
var account = new AccountDto();
using (var dr = new SafeDataReader(data))
{
if (dr.Read())
{
account.Id = dr.GetInt32("account_id");
account.Name = dr.GetString("account_name");
account.Description = !dr.IsDBNull("account_dscr") ? dr.GetString("account_dscr") : null;
account.Number = !dr.IsDBNull("account_number") ? dr.GetString("account_number") : null;
account.Balance = (Decimal?)dr.GetValue("balance");
account.LastReconciliationDate = !dr.IsDBNull("last_rec_date") ? dr.GetSmartDate("last_rec_date", true) : null;
account.LastReconciliationBalance = (Decimal?)dr.GetValue("last_rec_balance");
}
}
return account;
}
示例4: FetchVoucherEdit
private VoucherEditDto FetchVoucherEdit(SafeDataReader dr)
{
var voucherEdit = new VoucherEditDto();
// Value properties
voucherEdit.Id = dr.GetInt32("tran_id");
voucherEdit.Amount = (Decimal?)dr.GetValue("tran_amount");
voucherEdit.PersonId = !dr.IsDBNull("person_id") ? dr.GetString("person_id") : null;
voucherEdit.NamePrefix = !dr.IsDBNull("name_prefix") ? dr.GetString("name_prefix") : null;
voucherEdit.First = !dr.IsDBNull("first_name") ? dr.GetString("first_name") : null;
voucherEdit.Middle = !dr.IsDBNull("middle_name") ? dr.GetString("middle_name") : null;
voucherEdit.Last = !dr.IsDBNull("last_name") ? dr.GetString("last_name") : null;
voucherEdit.Suffix = !dr.IsDBNull("name_suffix") ? dr.GetString("name_suffix") : null;
voucherEdit.Title = !dr.IsDBNull("title") ? dr.GetString("title") : null;
voucherEdit.Company = !dr.IsDBNull("company") ? dr.GetString("company") : null;
voucherEdit.AddressLine1 = !dr.IsDBNull("address_1") ? dr.GetString("address_1") : null;
voucherEdit.AddressLine2 = !dr.IsDBNull("address_2") ? dr.GetString("address_2") : null;
voucherEdit.Municipality = !dr.IsDBNull("municipality") ? dr.GetString("municipality") : null;
voucherEdit.Region = !dr.IsDBNull("region") ? dr.GetString("region") : null;
voucherEdit.PostalCode = !dr.IsDBNull("postal_code") ? dr.GetString("postal_code") : null;
voucherEdit.Country = !dr.IsDBNull("country") ? dr.GetString("country") : null;
voucherEdit.PhoneNumber = !dr.IsDBNull("phone_number") ? dr.GetString("phone_number") : null;
voucherEdit.EmailAddress = !dr.IsDBNull("email") ? dr.GetString("email") : null;
voucherEdit.Updated = !dr.IsDBNull("updated") ? dr.GetSmartDate("updated", true) : null;
return voucherEdit;
}
示例5: BindAttackData
//.........这里部分代码省略.........
{
_attackerTechnologies.Add( new Technology(
dr.GetInt32( "ID" ),
dr.GetInt32( "FactionID" ),
dr.GetInt32( "HouseID" ),
dr.GetInt32( "GuildID" ),
dr.GetInt32( "TechnologyTypeID" ),
dr.GetInt32( "UnitID" ),
dr.GetInt32( "UnitClassID" ),
dr.GetString( "Name" ),
dr.GetString( "Faction" ),
dr.GetString( "House" ),
dr.GetString( "Guild" ),
dr.GetString( "Description" ),
dr.GetString( "TechnologyType" ),
dr.GetString( "Unit" ),
dr.GetString( "UnitClass" ),
dr.GetInt32( "Attack" ),
dr.GetInt32( "Defense" ),
dr.GetInt32( "Plunder" ),
dr.GetInt32( "Capture" ),
dr.GetInt32( "Stun" ),
dr.GetInt32( "Experience" ),
dr.GetDecimal( "RepopulationRate" ),
dr.GetDecimal( "DepopulationRate" ),
dr.GetInt32( "ResearchCost" ),
dr.GetInt32( "ResearchTime" ),
dr.GetInt32( "ResearchTurns" ),
dr.GetInt32( "TimeSpent" ),
dr.GetInt32( "TurnsSpent" ),
dr.GetInt32( "CreditsSpent" ),
dr.GetInt32( "ResearchStateID" ),
dr.GetString( "ResearchState" ),
dr.GetSmartDate( "ResearchStartedDate" ) ) );
}
}
if (dr.NextResult())
{
while (dr.Read())
{
_defenderHouse = new House(
dr.GetInt32( "ID" ),
dr.GetInt32( "UserID" ),
dr.GetInt32( "FactionID" ),
dr.GetString( "Faction" ),
dr.GetString( "FactionDisplay" ),
dr.GetString( "Name" ),
dr.GetInt32( "Intelligence" ),
dr.GetInt32( "Power" ),
dr.GetInt32( "Protection" ),
dr.GetInt32( "Affluence" ),
dr.GetInt32( "Speed" ),
dr.GetInt32( "Contingency" ),
dr.GetInt32( "LevelID" ),
(double)dr.GetDecimal( "Ambition" ),
dr.GetInt32( "Turns" ),
dr.GetInt32( "Credits" ),
dr.GetInt32( "MilitiaCount" ),
dr.GetInt32( "MilitaryCount" ),
dr.GetInt32( "MercenaryCount" ),
dr.GetInt32( "AgentCount" ),
dr.GetInt32( "Rank" ),
dr.GetInt32( "LastRank" ),
dr.GetInt32( "Points" ),
dr.GetInt32( "Experience" ),
示例6: GetTransactions
public override List<TransactionDTO> GetTransactions(int accountID)
{
_accountIDParm = accountID;
var myParm = _accountIDParm.ToString(CultureInfo.InvariantCulture);
var getAccountTransactions = MMSQLGetTransactionsByID + myParm;
if (myData.GetConnection(out _myAccessConn)) return null;
try
{
using (var myAccessCommand = new OleDbCommand(getAccountTransactions, _myAccessConn))
{
_myAccessConn.Open();
using (var dr = new SafeDataReader(myAccessCommand.ExecuteReader()))
using (dr)
while (dr.Read())
{
var myTransactionDTO = new TransactionDTO
{
TransactionID = dr.GetInt32(dr.GetOrdinal("TransactionID")),
AccountID = dr.GetInt32(dr.GetOrdinal("CustomerID")),
TransactionDate = dr.GetSmartDate(dr.GetOrdinal("TransDate")),
Amount = dr.GetDecimal(dr.GetOrdinal("Amount")),
Description = dr.GetString(dr.GetOrdinal("Description")),
TransactionCode = dr.GetString(dr.GetOrdinal("TranCode")),
UnitID = dr.GetInt32(dr.GetOrdinal("UnitID")),
RentalDate = dr.GetSmartDate(dr.GetOrdinal("RentalDate"))
};
mytransactionDTOs.Add(myTransactionDTO);
}
}
return mytransactionDTOs;
}
catch (Exception ex)
{
Console.WriteLine("Error: Failed to retrieve the required data from the DataBase.\n{0}", ex.Message);
return null;
}
finally
{
_myAccessConn.Close();
}
}
示例7: Fetch
private PaymentInfoDto Fetch(SafeDataReader dr)
{
var paymentInfo = new PaymentInfoDto();
paymentInfo.Id = dr.GetInt32("tran_id");
paymentInfo.BatchNum = dr.GetInt32("batch_num");
paymentInfo.PayDate = dr.GetSmartDate("pay_date");
paymentInfo.JobNum = dr.GetInt32("job_num");
paymentInfo.ThankYou1 = dr.GetString("thank_you_1");
paymentInfo.StudyTopic = dr.GetString("study_topic");
paymentInfo.ThankYou2 = dr.GetString("thank_you_2");
paymentInfo.MarketingResearchMessage = dr.GetString("marketing_research_message");
paymentInfo.CheckDate = dr.GetSmartDate("check_date");
paymentInfo.CheckNum = dr.GetString("check_num");
paymentInfo.Amount = dr.GetDecimal("tran_amount");
paymentInfo.PersonId = dr.GetString("person_id");
paymentInfo.Prefix = dr.GetString("name_prefix");
paymentInfo.FirstName = dr.GetString("first_name");
paymentInfo.MiddleName = dr.GetString("middle_name");
paymentInfo.LastName = dr.GetString("last_name");
paymentInfo.NameSuffix = dr.GetString("name_suffix");
paymentInfo.Title = dr.GetString("title");
paymentInfo.Company = dr.GetString("company");
paymentInfo.Address1 = dr.GetString("address_1");
paymentInfo.Address2 = dr.GetString("address_2");
paymentInfo.Municipality = dr.GetString("municipality");
paymentInfo.Region = dr.GetString("region");
paymentInfo.PostalCode = dr.GetString("postal_code");
paymentInfo.Country = dr.GetString("country");
paymentInfo.Email = dr.GetString("email");
paymentInfo.PhoneNumber = dr.GetString("phone_number");
paymentInfo.Completed = dr.GetBoolean("print_flag");
return paymentInfo;
}