当前位置: 首页>>代码示例>>C#>>正文


C# OpenCbsCommand.ResetParams方法代码示例

本文整理汇总了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();
                }
            }
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:43,代码来源:InstallmentManager.cs

示例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();
            }
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:29,代码来源:InstallmentManager.cs


注:本文中的OpenCBS.Manager.OpenCbsCommand.ResetParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。