/*************************************************************************** * * 功能: 持久层基类 * 作者: Siasun * 日期: 2013/4/11 * * 修改日期: * 修改人: * 修改内容: * * *************************************************************************/ namespace SiaSun.LMS.Persistence { using System; using System.Collections; using System.Collections.Generic; using IBatisNet.Common; using IBatisNet.DataMapper; using IBatisNet.Common.Exceptions; using SiaSun.LMS.Model; /// /// SYS_USER /// public class P_SYS_USER : P_Base_House { public P_SYS_USER () { // // TODO: 此处添加SYS_USER的构造函数 // } /// /// 得到列表 /// public IList GetList() { return ExecuteQueryForList("SYS_USER_SELECT",null); } public SiaSun.LMS.Model.SYS_USER Login(string USER_CODE, string USER_PASSWORD) { Hashtable ht = new Hashtable(); ht.Add("USER_CODE", USER_CODE); ht.Add("USER_PASSWORD", USER_PASSWORD); SiaSun.LMS.Model.SYS_USER SYS_USER = new SiaSun.LMS.Model.SYS_USER(); SYS_USER = this.ExecuteQueryForObject("SYS_USER_LOGIN", ht); return SYS_USER; } /// /// 新建 /// public int Add(SYS_USER sys_user) { //int id = this.GetPrimaryID("SYS_USER","SYS_USER_ID"); //sys_user.USER_ID = id; return ExecuteInsert("SYS_USER_INSERT",sys_user); } /// /// 修改 /// public int Update(SYS_USER sys_user) { return ExecuteUpdate("SYS_USER_UPDATE",sys_user); } /// /// 得到明细 /// /// /// public SYS_USER GetModel(System.Int32 USER_ID) { return ExecuteQueryForObject("SYS_USER_SELECT_BY_ID",USER_ID); } /// /// 得到用户明细 /// /// /// public SYS_USER GetModel(string USER_CODE) { return ExecuteQueryForObject("SYS_USER_SELECT_BY_USER_CODE", USER_CODE); } /// /// 得到列表 /// public IList GetList_ROLE_ID(int ROLE_ID) { return this.ExecuteQueryForList("SYS_USER_SELECT_BY_ROLE_ID", ROLE_ID); } /// /// 得到列表 /// public IList GetList_ROLE_ID_NO(int ROLE_ID) { return this.ExecuteQueryForList("SYS_USER_SELECT_NOTBY_ROLE_ID", ROLE_ID); } /// /// 删除 /// /// public int Delete(System.Int32 USER_ID) { return ExecuteDelete("SYS_USER_DELETE",USER_ID); } } }