tijian_tieying/web/dccdc.DAL/OpeningrecordDal.cs
2025-02-20 12:14:39 +08:00

47 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using dccdc.Models;
namespace dccdc.DAL
{
public class OpeningrecordDal
{
public bool save(OpeningrecordModel model)
{
string sql = @"INSERT INTO [MJ_KMJL]
([sbid]
,[openid]
,[kmlx]
,[kmsj]
,[ygid]
,[sbygid])
VALUES (@sbid,
@openid,
@kmlx,
getDate(),
@ygid,
@sbygid)";
using (IDbConnection conn = CommHelper.GetSqlConnection())
{
var s = conn.Execute(sql, model) != 0 ? true : false;
return s;
}
}
public List<OpeningrecordModel> getId(int sbid)
{
using(IDbConnection conn = CommHelper.GetSqlConnection())
{
string param = "";
param = " and sbid=@sbid";
return conn.Query<OpeningrecordModel>("select * from MJ_KMJL where 1=1 " + param, new { @sbid = sbid }).ToList();
}
}
}
}