123456789101112131415161718192021222324252627282930313233343536373839 |
- using Cksoft.Data;
- using DllEapEntity.OFILM;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace DllEapDal.OFILM
- {
- public class MachineMaterialMstDal
- {
- public IDatabase CurrDb { get; set; }
- public MachineMaterialMstDal(IDatabase db)
- {
- CurrDb = db;
- }
- public int Insert(MachineMaterialMst mst, ref string errorinfo)
- {
- var res = CurrDb.InsertFor(mst, string.Empty);
- if (res > 0)
- {
- var sql = "select @@identity;";
- return Convert.ToInt32(CurrDb.FindList<string>(sql).FirstOrDefault() ?? "-1");
- }
- return -1;
- }
- public IEnumerable<MachineMaterialMst> Get(string filter,ref string errorinfo)
- {
- return CurrDb.FindListForCondition<MachineMaterialMst>(filter, ref errorinfo);
- }
- public int Update(MachineMaterialMst mst)
- {
- return CurrDb.UpdateFor(mst, string.Empty);
- }
- }
- }
|