using System; using System.Collections.Generic; using System.Linq; using WX.CRM.BLL.Base; using WX.CRM.BLL.Util; using WX.CRM.Common; using WX.CRM.IBLL.Res; using WX.CRM.Model.Entity; namespace WX.CRM.BLL.Res { public class RES_CUSTOMEREXTEND_BL : IRES_CUSTOMEREXTEND, IRES_CUSTOMEREXTEND_Q { #region 新增 public bool Create(ref ValidationErrors errors, RES_CUSTOMEREXTEND model) { try { using (WX.CRM.Model.Entity.crmContext db = new WX.CRM.Model.Entity.crmContext()) { model.PKID = new SEQUENCES_BL().Seq_base_get(WX.CRM.Model.Enum.PKIDType.LargeTable); db.RES_CUSTOMEREXTEND.Add(model); return db.SaveChanges().GetResult(); } } catch (Exception ex) { errors.Add(ex.Message); return false; } } #endregion #region 编辑 #endregion #region 查询 public List GetList_CustomerExt(string resid) { using (var db = new WX.CRM.Model.Entity.crmContext()) { resid = resid.Trim(); return db.RES_CUSTOMEREXTEND.Where(p => p.RESID == resid).ToList(); } } #endregion #region 获取单个实体类 public RES_CUSTOMEREXTEND GetModel_CustomerExt(decimal id) { using (var db = new WX.CRM.Model.Entity.crmContext()) { return db.RES_CUSTOMEREXTEND.FirstOrDefault(p => p.PKID == id); } } #endregion } }