當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。