コード例 #1
0
        public bool AddFinancePayDetail(FinancePayDetailEntity financePayDetailEntity)
        {
            bool flag = false;
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" @JournalID");
            sqlCommandText.Append(", @AuthorID");
            sqlCommandText.Append(", @EBankType");
            sqlCommandText.Append(", @TransactionID");
            sqlCommandText.Append(", @TotalFee");
            sqlCommandText.Append(", @Currency");
            sqlCommandText.Append(", @IsInCome");
            sqlCommandText.Append(", @PayType");
            sqlCommandText.Append(", @PayStatus");
            sqlCommandText.Append(", @PayDate");
            sqlCommandText.Append(", @ProductTable");
            sqlCommandText.Append(", @ProductID");
            sqlCommandText.Append(", @ProductDes");
            sqlCommandText.Append(", @UserAccount");
            sqlCommandText.Append(", @BankID");
            sqlCommandText.Append(", @BankNo");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.FinancePayDetail ({0},AddDate) VALUES ({1},getdate())", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd,"@JournalID",DbType.Int64,financePayDetailEntity.JournalID);
            db.AddInParameter(cmd,"@AuthorID",DbType.Int64,financePayDetailEntity.AuthorID);
            db.AddInParameter(cmd,"@EBankType",DbType.Byte,financePayDetailEntity.EBankType);
            db.AddInParameter(cmd,"@TransactionID",DbType.AnsiString,financePayDetailEntity.TransactionID);
            db.AddInParameter(cmd,"@TotalFee",DbType.Decimal,financePayDetailEntity.TotalFee);
            db.AddInParameter(cmd,"@Currency",DbType.AnsiString,financePayDetailEntity.Currency);
            db.AddInParameter(cmd,"@IsInCome",DbType.Byte,financePayDetailEntity.IsInCome);
            db.AddInParameter(cmd,"@PayType",DbType.Byte,financePayDetailEntity.PayType);
            db.AddInParameter(cmd,"@PayStatus",DbType.Byte,financePayDetailEntity.PayStatus);
            db.AddInParameter(cmd,"@PayDate",DbType.DateTime,financePayDetailEntity.PayDate);
            db.AddInParameter(cmd,"@ProductTable",DbType.AnsiString,financePayDetailEntity.ProductTable);
            db.AddInParameter(cmd,"@ProductID",DbType.AnsiString,financePayDetailEntity.ProductID);
            db.AddInParameter(cmd,"@ProductDes",DbType.AnsiString,financePayDetailEntity.ProductDes);
            db.AddInParameter(cmd,"@UserAccount",DbType.AnsiString,financePayDetailEntity.UserAccount);
            db.AddInParameter(cmd,"@BankID",DbType.AnsiString,financePayDetailEntity.BankID);
            db.AddInParameter(cmd,"@BankNo",DbType.AnsiString,financePayDetailEntity.BankNo);
            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch(SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
コード例 #2
0
 public ExecResult Add(FinancePayDetailEntity model)
 {
     IFinancePayDetailService service = ServiceContainer.Instance.Container.Resolve<IFinancePayDetailService>();
     bool result = service.AddFinancePayDetail(model);
     ExecResult execResult = new ExecResult();
     if (result)
     {
         execResult.result = EnumJsonResult.success.ToString();
         execResult.msg = "新增支付记录成功!";
     }
     else
     {
         execResult.result = EnumJsonResult.failure.ToString();
         execResult.msg = "新增支付记录失败!";
     }
     return execResult;
 }
コード例 #3
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="financePayDetail">FinancePayDetailEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteFinancePayDetail(FinancePayDetailEntity financePayDetail)
 {
     return FinancePayDetailBusProvider.DeleteFinancePayDetail(financePayDetail);
 }
コード例 #4
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="financePayDetail">FinancePayDetailEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFinancePayDetail(FinancePayDetailEntity financePayDetail)
 {
     return FinancePayDetailBusProvider.AddFinancePayDetail(financePayDetail);
 }
コード例 #5
0
 /// <summary>
 /// 更新存储媒介中的实体数据
 /// </summary>
 /// <param name="financePayDetail">FinancePayDetailEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateFinancePayDetail(FinancePayDetailEntity financePayDetail)
 {
     return FinancePayDetailBusProvider.UpdateFinancePayDetail(financePayDetail);
 }
コード例 #6
0
 /// <summary>
 /// 从存储媒介删除实体数据
 /// </summary>
 /// <param name="financePayDetail">FinancePayDetailEntity实体对象</param>
 /// <returns>true:删除成功 false:删除失败</returns>
 public bool DeleteFinancePayDetail(FinancePayDetailEntity financePayDetail)
 {
     return FinancePayDetailDataAccess.Instance.DeleteFinancePayDetail(financePayDetail);
 }
コード例 #7
0
 /// <summary>
 /// 将实体数据存入存储媒介(持久化一个对象)
 /// </summary>
 /// <param name="financePayDetail">FinancePayDetailEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFinancePayDetail(FinancePayDetailEntity financePayDetail)
 {
     return FinancePayDetailDataAccess.Instance.AddFinancePayDetail(financePayDetail);
 }
コード例 #8
0
        public bool UpdateFinancePayDetail(FinancePayDetailEntity financePayDetailEntity)
        {
            bool flag = false;
            StringBuilder whereCommandText = new StringBuilder();
            whereCommandText.Append("  BillID=@BillID");
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" JournalID=@JournalID");
            sqlCommandText.Append(", AuthorID=@AuthorID");
            sqlCommandText.Append(", EBankType=@EBankType");
            sqlCommandText.Append(", TransactionID=@TransactionID");
            sqlCommandText.Append(", TotalFee=@TotalFee");
            sqlCommandText.Append(", Currency=@Currency");
            sqlCommandText.Append(", IsInCome=@IsInCome");
            sqlCommandText.Append(", PayType=@PayType");
            sqlCommandText.Append(", PayStatus=@PayStatus");
            sqlCommandText.Append(", PayDate=@PayDate");
            sqlCommandText.Append(", ProductTable=@ProductTable");
            sqlCommandText.Append(", ProductID=@ProductID");
            sqlCommandText.Append(", ProductDes=@ProductDes");
            sqlCommandText.Append(", UserAccount=@UserAccount");
            sqlCommandText.Append(", BankID=@BankID");
            sqlCommandText.Append(", BankNo=@BankNo");
            sqlCommandText.Append(", AddDate=@AddDate");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("UPDATE dbo.FinancePayDetail SET {0} WHERE  {1}",sqlCommandText.ToString(),whereCommandText.ToString()));

            db.AddInParameter(cmd,"@BillID",DbType.Int64,financePayDetailEntity.BillID);
            db.AddInParameter(cmd,"@JournalID",DbType.Int64,financePayDetailEntity.JournalID);
            db.AddInParameter(cmd,"@AuthorID",DbType.Int64,financePayDetailEntity.AuthorID);
            db.AddInParameter(cmd,"@EBankType",DbType.Byte,financePayDetailEntity.EBankType);
            db.AddInParameter(cmd,"@TransactionID",DbType.AnsiString,financePayDetailEntity.TransactionID);
            db.AddInParameter(cmd,"@TotalFee",DbType.Decimal,financePayDetailEntity.TotalFee);
            db.AddInParameter(cmd,"@Currency",DbType.AnsiString,financePayDetailEntity.Currency);
            db.AddInParameter(cmd,"@IsInCome",DbType.Byte,financePayDetailEntity.IsInCome);
            db.AddInParameter(cmd,"@PayType",DbType.Byte,financePayDetailEntity.PayType);
            db.AddInParameter(cmd,"@PayStatus",DbType.Byte,financePayDetailEntity.PayStatus);
            db.AddInParameter(cmd,"@PayDate",DbType.DateTime,financePayDetailEntity.PayDate);
            db.AddInParameter(cmd,"@ProductTable",DbType.AnsiString,financePayDetailEntity.ProductTable);
            db.AddInParameter(cmd,"@ProductID",DbType.AnsiString,financePayDetailEntity.ProductID);
            db.AddInParameter(cmd,"@ProductDes",DbType.AnsiString,financePayDetailEntity.ProductDes);
            db.AddInParameter(cmd,"@UserAccount",DbType.AnsiString,financePayDetailEntity.UserAccount);
            db.AddInParameter(cmd,"@BankID",DbType.AnsiString,financePayDetailEntity.BankID);
            db.AddInParameter(cmd,"@BankNo",DbType.AnsiString,financePayDetailEntity.BankNo);
            db.AddInParameter(cmd,"@AddDate",DbType.DateTime,financePayDetailEntity.AddDate);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch(SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
コード例 #9
0
 public List<FinancePayDetailEntity> MakeFinancePayDetailList(IDataReader dr)
 {
     List<FinancePayDetailEntity> list=new List<FinancePayDetailEntity>();
     while(dr.Read())
     {
      FinancePayDetailEntity financePayDetailEntity=new FinancePayDetailEntity();
     financePayDetailEntity.BillID = (Int64)dr["BillID"];
     financePayDetailEntity.JournalID = (Int64)dr["JournalID"];
     financePayDetailEntity.AuthorID = (Int64)dr["AuthorID"];
     financePayDetailEntity.EBankType = (Byte)dr["EBankType"];
     financePayDetailEntity.TransactionID = (String)dr["TransactionID"];
     financePayDetailEntity.TotalFee = (Decimal)dr["TotalFee"];
     financePayDetailEntity.Currency = (String)dr["Currency"];
     financePayDetailEntity.IsInCome = (Byte)dr["IsInCome"];
     financePayDetailEntity.PayType = (Byte)dr["PayType"];
     financePayDetailEntity.PayStatus = (Byte)dr["PayStatus"];
     financePayDetailEntity.PayDate = (DateTime)dr["PayDate"];
     financePayDetailEntity.ProductTable = (String)dr["ProductTable"];
     financePayDetailEntity.ProductID = (String)dr["ProductID"];
     financePayDetailEntity.ProductDes = Convert.IsDBNull(dr["ProductDes"]) ? null : (String)dr["ProductDes"];
     financePayDetailEntity.UserAccount = Convert.IsDBNull(dr["UserAccount"]) ? null : (String)dr["UserAccount"];
     financePayDetailEntity.BankID = Convert.IsDBNull(dr["BankID"]) ? null : (String)dr["BankID"];
     financePayDetailEntity.BankNo = Convert.IsDBNull(dr["BankNo"]) ? null : (String)dr["BankNo"];
     financePayDetailEntity.AddDate = (DateTime)dr["AddDate"];
        list.Add(financePayDetailEntity);
     }
     dr.Close();
     return list;
 }
コード例 #10
0
 public FinancePayDetailEntity MakeFinancePayDetail(DataRow dr)
 {
     FinancePayDetailEntity financePayDetailEntity=null;
     if(dr!=null)
     {
          financePayDetailEntity=new FinancePayDetailEntity();
          financePayDetailEntity.BillID = (Int64)dr["BillID"];
          financePayDetailEntity.JournalID = (Int64)dr["JournalID"];
          financePayDetailEntity.AuthorID = (Int64)dr["AuthorID"];
          financePayDetailEntity.EBankType = (Byte)dr["EBankType"];
          financePayDetailEntity.TransactionID = (String)dr["TransactionID"];
          financePayDetailEntity.TotalFee = (Decimal)dr["TotalFee"];
          financePayDetailEntity.Currency = (String)dr["Currency"];
          financePayDetailEntity.IsInCome = (Byte)dr["IsInCome"];
          financePayDetailEntity.PayType = (Byte)dr["PayType"];
          financePayDetailEntity.PayStatus = (Byte)dr["PayStatus"];
          financePayDetailEntity.PayDate = (DateTime)dr["PayDate"];
          financePayDetailEntity.ProductTable = (String)dr["ProductTable"];
          financePayDetailEntity.ProductID = (String)dr["ProductID"];
          financePayDetailEntity.ProductDes = Convert.IsDBNull(dr["ProductDes"]) ? null : (String)dr["ProductDes"];
          financePayDetailEntity.UserAccount = Convert.IsDBNull(dr["UserAccount"]) ? null : (String)dr["UserAccount"];
          financePayDetailEntity.BankID = Convert.IsDBNull(dr["BankID"]) ? null : (String)dr["BankID"];
          financePayDetailEntity.BankNo = Convert.IsDBNull(dr["BankNo"]) ? null : (String)dr["BankNo"];
          financePayDetailEntity.AddDate = (DateTime)dr["AddDate"];
     }
     return financePayDetailEntity;
 }
コード例 #11
0
        public bool DeleteFinancePayDetail(FinancePayDetailEntity financePayDetailEntity)
        {
            bool flag = false;
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append("DELETE FROM dbo.FinancePayDetail");
            sqlCommandText.Append(" WHERE  BillID=@BillID");

            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            db.AddInParameter(cmd,"@BillID",DbType.Int64,financePayDetailEntity.BillID);

            try
            {
                db.ExecuteNonQuery(cmd);
                flag = true;
            }
            catch(SqlException sqlEx)
            {
                throw sqlEx;
            }
            return flag;
        }
コード例 #12
0
 /// <summary>
 /// 新增支付记录
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public ExecResult AddFinancePayDetail(FinancePayDetailEntity model)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult result = clientHelper.Post<ExecResult, FinancePayDetailEntity>(GetAPIUrl(APIConstant.FINANCEPAYDETAIL_ADD), model);
     return result;
 }