本文整理汇总了C#中OpenCBS.Manager.OpenCbsCommand.ResetParams方法的典型用法代码示例。如果您正苦于以下问题:C# OpenCbsCommand.ResetParams方法的具体用法?C# OpenCbsCommand.ResetParams怎么用?C# OpenCbsCommand.ResetParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.Manager.OpenCbsCommand
的用法示例。
在下文中一共展示了OpenCbsCommand.ResetParams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddInstallments
public void AddInstallments(List<Installment> pInstallments, int pLoanId, SqlTransaction pSqlTransac)
{
const string q = @"INSERT INTO Installments(
expected_date,
interest_repayment,
capital_repayment,
contract_id,
number,
paid_interest,
paid_capital,
fees_unpaid,
paid_date,
paid_fees,
comment,
pending,
start_date,
olb)
VALUES (
@expectedDate,
@interestsRepayment,
@capitalRepayment,
@contractId,
@number,
@paidInterests,
@paidCapital,
@feesUnpaid,
@paidDate,
@paid_fees,
@comment,
@pending,
@start_date,
@olb)";
using(OpenCbsCommand c = new OpenCbsCommand(q, pSqlTransac.Connection, pSqlTransac))
{
foreach(Installment installment in pInstallments)
{
SetInstallment(installment,pLoanId, c);
c.ExecuteNonQuery();
c.ResetParams();
}
}
}
示例2: UpdateInstallment
public void UpdateInstallment(DateTime date, int id, int number)
{
// Update installement in database
const string q = @"UPDATE Installments
SET expected_date = @expectedDate
WHERE contract_id = @contractId
AND number = @number";
using (SqlConnection conn = GetConnection())
using (OpenCbsCommand c = new OpenCbsCommand(q, conn))
{
//primary key = contractId + number
c.AddParam("@contractId", id);
c.AddParam("@number", number);
c.AddParam("@expectedDate", date);
c.ExecuteNonQuery();
c.ResetParams();
c.CommandText = @"UPDATE dbo.Installments
SET start_date = @start_date
WHERE contract_id = @contractId
AND number = @number";
c.AddParam("@contractId", id);
c.AddParam("@number", number + 1);
c.AddParam("@start_date", date);
c.ExecuteNonQuery();
}
}