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 getId(int sbid) { using(IDbConnection conn = CommHelper.GetSqlConnection()) { string param = ""; param = " and sbid=@sbid"; return conn.Query("select * from MJ_KMJL where 1=1 " + param, new { @sbid = sbid }).ToList(); } } } }