| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using CoreFS.CA06;
- using DbHelp = Core.StlMes.Client.Sale.DbHelp;
- namespace Core.StlMes.Client.Sale.SaleFundMgt.FundDAL.FundSecondLevelAccountDAL
- {
- /// <summary>
- /// 二级账户资金转移情况管理
- /// </summary>
- public class FundSecondUsedDetailDAL:BaseDAL.BaseDAL
- {
- public FundSecondUsedDetailDAL(OpeBase ob)
- : base(ob)
- {
- }
- private string SQL_QUERY = @" select
- trans_seq,
- trans_type,
- balancesubject,
- buyercode,
- secondaccount,
- money,
- leavemoney,
- otheraccount,
- trans_time,
- trans_person,
- remark,
- updatetime from sel_fund_secondle_usedetail
- where 1 = 1 {0} ";
- private string SQL_STR_INSERT = @" insert into sel_fund_secondle_usedetail(
- trans_seq,
- trans_type,
- balancesubject,
- buyercode,
- secondaccount,
- money,
- leavemoney,
- otheraccount,
- trans_time,
- trans_person,
- remark,
- updatetime
- )
- values('{0}','{1}','{2}','{3}','{4}',{5},{6},'{7}',
- sysdate,'{8}','{9}',sysdate)";
- private string SQL_STR_DELETEBYSEQANDTYPE =
- @"delete from sel_fund_secondle_usedetail where 1 = 1 and trans_seq = '{0}' and trans_type = '{1}' ";
- /// <summary>
- /// 获取二级账户明细数据
- /// </summary>
- /// <param name="sqlCondition"></param>
- /// <returns></returns>
- public DataSet GetSelFundSecondleUsedDetail(string sqlCondition)
- {
- string sqlStr = string.Format(SQL_QUERY,sqlCondition);
- DataSet ds = base.ExecuteReaderForSaleFund(sqlStr);
- base.SetDataSetCaption(ref ds,base.GetColumnNameAndCaption());
- return ds;
- }
- /// <summary>
- /// 通过结算单位,客户单位,二级单位名称返回数据集
- /// </summary>
- /// <param name="acct"></param>
- /// <returns></returns>
- public DataSet GetSelFundSecondUsedDetailBybalAndBuyercodeAndsecondName(Model.SEL_FUND_SECONDLE_USEDETAIL acct)
- {
- return this.GetSelFundSecondleUsedDetail(base.GetSqlConditon(acct.BALANCESUBJECT,acct.BUYERCODE,acct.SECONDACCOUNT));
- }
- /// <summary>
- /// 通过结算单位,客户单位,二级单位名称返回数据集
- /// </summary>
- /// <param name="balancesubject"></param>
- /// <param name="buyercode"></param>
- /// <param name="secondacct"></param>
- /// <returns></returns>
- public DataSet GetSelFundSecondUsedDetailBybalAndBuyercodeAndsecondName(string balancesubject,string buyercode,string secondacct)
- {
- return this.GetSelFundSecondleUsedDetail(base.GetSqlConditon(balancesubject, buyercode, secondacct));
- }
- private string GetInsertSqlStr(Model.SEL_FUND_SECONDLE_USEDETAIL acct, out string err)
- {
- err = "";
- try
- {
-
- if (!Model.SEL_FUND_SECONDLE_USEDETAIL.IsReasonable(acct, out err))
- {
- return "";
- }
- string SQL_INSERT = string.Format(SQL_STR_INSERT,
- acct.TRANS_SEQ,
- acct.TRANS_TYPE,
- acct.BALANCESUBJECT,
- acct.BUYERCODE,
- acct.SECONDACCOUNT,
- acct.MONEY,
- acct.LEAVEMONEY,
- acct.OTHERACCOUNT,
- acct.TRANS_PERSON,
- acct.REMARK
- );
- return SQL_INSERT;
- }
- catch(Exception ex)
- {
- err = ex.Message;
- return "";
- }
- }
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="acct"></param>
- /// <param name="err"></param>
- public void Insert(Model.SEL_FUND_SECONDLE_USEDETAIL acct,out string err)
- {
- err = "";
- string sql = GetInsertSqlStr(acct, out err);
- if (sql.Length == 0)
- return;
- base.ExecuteNoReaderForSaleFund(sql,out err);
- }
- /// <summary>
- /// 新增,带事务
- /// </summary>
- /// <param name="acct"></param>
- /// <param name="transaction"></param>
- public void Insert(Model.SEL_FUND_SECONDLE_USEDETAIL acct, DbHelp.DbTransaction transaction)
- {
- string err = "";
- string sql = GetInsertSqlStr(acct, out err);
- if (err.Length > 0)
- {
- transaction.ErrMsg = err;
- return;
- }
- base.ExecuteNoReaderForSaleFund(sql, transaction);
- }
- public string Sql_Insert(Model.SEL_FUND_SECONDLE_USEDETAIL acct)
- {
- string err = "";
- string sql = GetInsertSqlStr(acct, out err);
- return sql;
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="busiSeq"></param>
- /// <param name="transType"></param>
- public void Delete(string busiSeq, string transType)
- {
- string sqlStr = string.Format(SQL_STR_DELETEBYSEQANDTYPE, busiSeq, transType);
- base.ExecuteNoReaderForSaleFund(sqlStr);
- }
-
- }
- }
|