12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Models;
- using System.Data.SqlClient;
- using System.Data;
- namespace DAL
- {
- /// <summary>
- /// 信用卡账单访问层
- /// </summary>
- public class BillInfoService
- {
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="sdt">对象</param>
- public bool AddBill(BillInfo b)
- {
- string sql = "INSERT INTO BillInfo(TransDate,PostDate,Description,Amount,Currency,IsDel)VALUES(@TransDate,@PostDate,@Description,@Amount,@Currency,0)";
- SqlParameter[] parameter = new SqlParameter[]{
- new SqlParameter("@TransDate",b.TransDate),
- new SqlParameter("@PostDate",b.PostDate),
- new SqlParameter("@Description",b.Description),
- new SqlParameter("@Amount",b.Amount),
- new SqlParameter("@Currency",b.Currency)
- };
- if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0)
- return true;
- return false;
- }
- /// <summary>
- /// 获取全部未付款数据 - 分页
- /// </summary>
- /// <returns></returns>
- public List<BillInfo> GetAll(int pageIndex, out int sumPage, out int totalRecord)
- {
- string sqlwhere = "IsDel =0 and Description<>''";
- return PageBase<BillInfo>.excutePageSql(new BillInfo(), "BillInfo", "BillInfo", "*", "id desc", sqlwhere, 10, pageIndex, out sumPage, out totalRecord);
- }
- /// <summary>
- /// 删除不处理的信用卡信息
- /// </summary>
- /// <param name="id"></param>
- public void DelBill(int id)
- {
- SqlHelper.ExecuteNonQuery("delete from billinfo", CommandType.Text, null);
- }
- }
- }
|