Users.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:26k
- //------------------------------------------------------------------------------
- // 创建标识: Copyright (C) 2009 Socansoft.com 版权所有
- // 创建描述: SocanCode代码生成器 V4.3.2.3 自动创建于 2009-12-23 10:03:32
- //
- // 功能描述:
- //
- // 修改标识:
- // 修改描述:
- //------------------------------------------------------------------------------
- using System;
- using System.Data;
- using System.Data.Common;
- using System.Text;
- using System.Collections;
- using System.Collections.Generic;
- namespace SqlServerDAL
- {
- /// <summary>
- /// 数据访问类 Users
- /// </summary>
- public class Users : DALHelper
- {
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public int Add(Model.Users model)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("INSERT INTO Users(");
- strSql.Append("UserId,UserId2,UserNo,UserName,Password,PrivId,PrivId2,PostPriv,PostDept,DeptId,DeptId2,CanBroadcast,Sex,Birthday,IsHideBirthday,TelNoDept,FaxNoDept,AddressHome,ZipHome,TelHome,Mobile,IsHideMobile,Bp,Email,Oicq,Icq,Msn,Skype,NickName,Avatar,MenuType,MenuHide,SmsOn,CallSound,Theme,Note,MytableLeft,MytableRight,EmailCapacity,FolderCapacity,OnlineTime,DutyType,AttendCard,State,LastPassTime,LastVisitTime,LastIp,Disabled,BindIp,UsingKey,UGuid,UKey,UExt,NotUser,NotTable,DefaultMenu,TablePhoto,WebmailNum,WebmailCapacity,AdUserId,UsingAd,Photo,EmailSite)");
- strSql.Append(" VALUES (");
- strSql.Append("@in_UserId,@in_UserId2,@in_UserNo,@in_UserName,@in_Password,@in_PrivId,@in_PrivId2,@in_PostPriv,@in_PostDept,@in_DeptId,@in_DeptId2,@in_CanBroadcast,@in_Sex,@in_Birthday,@in_IsHideBirthday,@in_TelNoDept,@in_FaxNoDept,@in_AddressHome,@in_ZipHome,@in_TelHome,@in_Mobile,@in_IsHideMobile,@in_Bp,@in_Email,@in_Oicq,@in_Icq,@in_Msn,@in_Skype,@in_NickName,@in_Avatar,@in_MenuType,@in_MenuHide,@in_SmsOn,@in_CallSound,@in_Theme,@in_Note,@in_MytableLeft,@in_MytableRight,@in_EmailCapacity,@in_FolderCapacity,@in_OnlineTime,@in_DutyType,@in_AttendCard,@in_State,@in_LastPassTime,@in_LastVisitTime,@in_LastIp,@in_Disabled,@in_BindIp,@in_UsingKey,@in_UGuid,@in_UKey,@in_UExt,@in_NotUser,@in_NotTable,@in_DefaultMenu,@in_TablePhoto,@in_WebmailNum,@in_WebmailCapacity,@in_AdUserId,@in_UsingAd,@in_Photo,@in_EmailSite)");
- DbParameter[] cmdParms = {
- DataBaseOAHelper.CreateInDbParameter("@in_UserId", DbType.String, model.UserId),
- DataBaseOAHelper.CreateInDbParameter("@in_UserId2", DbType.String, model.UserId2),
- DataBaseOAHelper.CreateInDbParameter("@in_UserNo", DbType.Int32, model.UserNo),
- DataBaseOAHelper.CreateInDbParameter("@in_UserName", DbType.String, model.UserName),
- DataBaseOAHelper.CreateInDbParameter("@in_Password", DbType.String, model.Password),
- DataBaseOAHelper.CreateInDbParameter("@in_PrivId", DbType.Int32, model.PrivId),
- DataBaseOAHelper.CreateInDbParameter("@in_PrivId2", DbType.String, model.PrivId2),
- DataBaseOAHelper.CreateInDbParameter("@in_PostPriv", DbType.String, model.PostPriv),
- DataBaseOAHelper.CreateInDbParameter("@in_PostDept", DbType.String, model.PostDept),
- DataBaseOAHelper.CreateInDbParameter("@in_DeptId", DbType.Int32, model.DeptId),
- DataBaseOAHelper.CreateInDbParameter("@in_DeptId2", DbType.String, model.DeptId2),
- DataBaseOAHelper.CreateInDbParameter("@in_CanBroadcast", DbType.Boolean, model.CanBroadcast),
- DataBaseOAHelper.CreateInDbParameter("@in_Sex", DbType.Boolean, model.Sex),
- DataBaseOAHelper.CreateInDbParameter("@in_Birthday", DbType.String, model.Birthday),
- DataBaseOAHelper.CreateInDbParameter("@in_IsHideBirthday", DbType.Boolean, model.IsHideBirthday),
- DataBaseOAHelper.CreateInDbParameter("@in_TelNoDept", DbType.String, model.TelNoDept),
- DataBaseOAHelper.CreateInDbParameter("@in_FaxNoDept", DbType.String, model.FaxNoDept),
- DataBaseOAHelper.CreateInDbParameter("@in_AddressHome", DbType.String, model.AddressHome),
- DataBaseOAHelper.CreateInDbParameter("@in_ZipHome", DbType.String, model.ZipHome),
- DataBaseOAHelper.CreateInDbParameter("@in_TelHome", DbType.String, model.TelHome),
- DataBaseOAHelper.CreateInDbParameter("@in_Mobile", DbType.String, model.Mobile),
- DataBaseOAHelper.CreateInDbParameter("@in_IsHideMobile", DbType.Boolean, model.IsHideMobile),
- DataBaseOAHelper.CreateInDbParameter("@in_Bp", DbType.String, model.Bp),
- DataBaseOAHelper.CreateInDbParameter("@in_Email", DbType.String, model.Email),
- DataBaseOAHelper.CreateInDbParameter("@in_Oicq", DbType.String, model.Oicq),
- DataBaseOAHelper.CreateInDbParameter("@in_Icq", DbType.String, model.Icq),
- DataBaseOAHelper.CreateInDbParameter("@in_Msn", DbType.String, model.Msn),
- DataBaseOAHelper.CreateInDbParameter("@in_Skype", DbType.String, model.Skype),
- DataBaseOAHelper.CreateInDbParameter("@in_NickName", DbType.String, model.NickName),
- DataBaseOAHelper.CreateInDbParameter("@in_Avatar", DbType.Int32, model.Avatar),
- DataBaseOAHelper.CreateInDbParameter("@in_MenuType", DbType.Boolean, model.MenuType),
- DataBaseOAHelper.CreateInDbParameter("@in_MenuHide", DbType.Boolean, model.MenuHide),
- DataBaseOAHelper.CreateInDbParameter("@in_SmsOn", DbType.Boolean, model.SmsOn),
- DataBaseOAHelper.CreateInDbParameter("@in_CallSound", DbType.Int32, model.CallSound),
- DataBaseOAHelper.CreateInDbParameter("@in_Theme", DbType.Int32, model.Theme),
- DataBaseOAHelper.CreateInDbParameter("@in_Note", DbType.String, model.Note),
- DataBaseOAHelper.CreateInDbParameter("@in_MytableLeft", DbType.String, model.MytableLeft),
- DataBaseOAHelper.CreateInDbParameter("@in_MytableRight", DbType.String, model.MytableRight),
- DataBaseOAHelper.CreateInDbParameter("@in_EmailCapacity", DbType.Int32, model.EmailCapacity),
- DataBaseOAHelper.CreateInDbParameter("@in_FolderCapacity", DbType.Int32, model.FolderCapacity),
- DataBaseOAHelper.CreateInDbParameter("@in_OnlineTime", DbType.Single, model.OnlineTime),
- DataBaseOAHelper.CreateInDbParameter("@in_DutyType", DbType.Int32, model.DutyType),
- DataBaseOAHelper.CreateInDbParameter("@in_AttendCard", DbType.String, model.AttendCard),
- DataBaseOAHelper.CreateInDbParameter("@in_State", DbType.Int32, model.State),
- DataBaseOAHelper.CreateInDbParameter("@in_LastPassTime", DbType.String, model.LastPassTime),
- DataBaseOAHelper.CreateInDbParameter("@in_LastVisitTime", DbType.String, model.LastVisitTime),
- DataBaseOAHelper.CreateInDbParameter("@in_LastIp", DbType.String, model.LastIp),
- DataBaseOAHelper.CreateInDbParameter("@in_Disabled", DbType.Boolean, model.Disabled),
- DataBaseOAHelper.CreateInDbParameter("@in_BindIp", DbType.String, model.BindIp),
- DataBaseOAHelper.CreateInDbParameter("@in_UsingKey", DbType.Boolean, model.UsingKey),
- DataBaseOAHelper.CreateInDbParameter("@in_UGuid", DbType.String, model.UGuid),
- DataBaseOAHelper.CreateInDbParameter("@in_UKey", DbType.String, model.UKey),
- DataBaseOAHelper.CreateInDbParameter("@in_UExt", DbType.String, model.UExt),
- DataBaseOAHelper.CreateInDbParameter("@in_NotUser", DbType.Int32, model.NotUser),
- DataBaseOAHelper.CreateInDbParameter("@in_NotTable", DbType.Int32, model.NotTable),
- DataBaseOAHelper.CreateInDbParameter("@in_DefaultMenu", DbType.String, model.DefaultMenu),
- DataBaseOAHelper.CreateInDbParameter("@in_TablePhoto", DbType.String, model.TablePhoto),
- DataBaseOAHelper.CreateInDbParameter("@in_WebmailNum", DbType.Int32, model.WebmailNum),
- DataBaseOAHelper.CreateInDbParameter("@in_WebmailCapacity", DbType.Int32, model.WebmailCapacity),
- DataBaseOAHelper.CreateInDbParameter("@in_AdUserId", DbType.String, model.AdUserId),
- DataBaseOAHelper.CreateInDbParameter("@in_UsingAd", DbType.Boolean, model.UsingAd),
- DataBaseOAHelper.CreateInDbParameter("@in_Photo", DbType.AnsiString, model.Photo),
- DataBaseOAHelper.CreateInDbParameter("@in_EmailSite", DbType.AnsiString, model.EmailSite)};
- return DataBaseOAHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), cmdParms);
- }
- /// <summary>
- /// 更新一条数据
- /// </summary>
- public int Update(Model.Users model)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("UPDATE Users SET ");
- strSql.Append("UserId=@in_UserId,");
- strSql.Append("UserId2=@in_UserId2,");
- strSql.Append("UserNo=@in_UserNo,");
- strSql.Append("UserName=@in_UserName,");
- strSql.Append("Password=@in_Password,");
- strSql.Append("PrivId=@in_PrivId,");
- strSql.Append("PrivId2=@in_PrivId2,");
- strSql.Append("PostPriv=@in_PostPriv,");
- strSql.Append("PostDept=@in_PostDept,");
- strSql.Append("DeptId=@in_DeptId,");
- strSql.Append("DeptId2=@in_DeptId2,");
- strSql.Append("CanBroadcast=@in_CanBroadcast,");
- strSql.Append("Sex=@in_Sex,");
- strSql.Append("Birthday=@in_Birthday,");
- strSql.Append("IsHideBirthday=@in_IsHideBirthday,");
- strSql.Append("TelNoDept=@in_TelNoDept,");
- strSql.Append("FaxNoDept=@in_FaxNoDept,");
- strSql.Append("AddressHome=@in_AddressHome,");
- strSql.Append("ZipHome=@in_ZipHome,");
- strSql.Append("TelHome=@in_TelHome,");
- strSql.Append("Mobile=@in_Mobile,");
- strSql.Append("IsHideMobile=@in_IsHideMobile,");
- strSql.Append("Bp=@in_Bp,");
- strSql.Append("Email=@in_Email,");
- strSql.Append("Oicq=@in_Oicq,");
- strSql.Append("Icq=@in_Icq,");
- strSql.Append("Msn=@in_Msn,");
- strSql.Append("Skype=@in_Skype,");
- strSql.Append("NickName=@in_NickName,");
- strSql.Append("Avatar=@in_Avatar,");
- strSql.Append("MenuType=@in_MenuType,");
- strSql.Append("MenuHide=@in_MenuHide,");
- strSql.Append("SmsOn=@in_SmsOn,");
- strSql.Append("CallSound=@in_CallSound,");
- strSql.Append("Theme=@in_Theme,");
- strSql.Append("Note=@in_Note,");
- strSql.Append("MytableLeft=@in_MytableLeft,");
- strSql.Append("MytableRight=@in_MytableRight,");
- strSql.Append("EmailCapacity=@in_EmailCapacity,");
- strSql.Append("FolderCapacity=@in_FolderCapacity,");
- strSql.Append("OnlineTime=@in_OnlineTime,");
- strSql.Append("DutyType=@in_DutyType,");
- strSql.Append("AttendCard=@in_AttendCard,");
- strSql.Append("State=@in_State,");
- strSql.Append("LastPassTime=@in_LastPassTime,");
- strSql.Append("LastVisitTime=@in_LastVisitTime,");
- strSql.Append("LastIp=@in_LastIp,");
- strSql.Append("Disabled=@in_Disabled,");
- strSql.Append("BindIp=@in_BindIp,");
- strSql.Append("UsingKey=@in_UsingKey,");
- strSql.Append("UGuid=@in_UGuid,");
- strSql.Append("UKey=@in_UKey,");
- strSql.Append("UExt=@in_UExt,");
- strSql.Append("NotUser=@in_NotUser,");
- strSql.Append("NotTable=@in_NotTable,");
- strSql.Append("DefaultMenu=@in_DefaultMenu,");
- strSql.Append("TablePhoto=@in_TablePhoto,");
- strSql.Append("WebmailNum=@in_WebmailNum,");
- strSql.Append("WebmailCapacity=@in_WebmailCapacity,");
- strSql.Append("AdUserId=@in_AdUserId,");
- strSql.Append("UsingAd=@in_UsingAd,");
- strSql.Append("Photo=@in_Photo,");
- strSql.Append("EmailSite=@in_EmailSite");
- strSql.Append(" WHERE Id=@in_Id");
- DbParameter[] cmdParms = {
- DataBaseOAHelper.CreateInDbParameter("@in_UserId", DbType.String, model.UserId),
- DataBaseOAHelper.CreateInDbParameter("@in_UserId2", DbType.String, model.UserId2),
- DataBaseOAHelper.CreateInDbParameter("@in_UserNo", DbType.Int32, model.UserNo),
- DataBaseOAHelper.CreateInDbParameter("@in_UserName", DbType.String, model.UserName),
- DataBaseOAHelper.CreateInDbParameter("@in_Password", DbType.String, model.Password),
- DataBaseOAHelper.CreateInDbParameter("@in_PrivId", DbType.Int32, model.PrivId),
- DataBaseOAHelper.CreateInDbParameter("@in_PrivId2", DbType.String, model.PrivId2),
- DataBaseOAHelper.CreateInDbParameter("@in_PostPriv", DbType.String, model.PostPriv),
- DataBaseOAHelper.CreateInDbParameter("@in_PostDept", DbType.String, model.PostDept),
- DataBaseOAHelper.CreateInDbParameter("@in_DeptId", DbType.Int32, model.DeptId),
- DataBaseOAHelper.CreateInDbParameter("@in_DeptId2", DbType.String, model.DeptId2),
- DataBaseOAHelper.CreateInDbParameter("@in_CanBroadcast", DbType.Boolean, model.CanBroadcast),
- DataBaseOAHelper.CreateInDbParameter("@in_Sex", DbType.Boolean, model.Sex),
- DataBaseOAHelper.CreateInDbParameter("@in_Birthday", DbType.String, model.Birthday),
- DataBaseOAHelper.CreateInDbParameter("@in_IsHideBirthday", DbType.Boolean, model.IsHideBirthday),
- DataBaseOAHelper.CreateInDbParameter("@in_TelNoDept", DbType.String, model.TelNoDept),
- DataBaseOAHelper.CreateInDbParameter("@in_FaxNoDept", DbType.String, model.FaxNoDept),
- DataBaseOAHelper.CreateInDbParameter("@in_AddressHome", DbType.String, model.AddressHome),
- DataBaseOAHelper.CreateInDbParameter("@in_ZipHome", DbType.String, model.ZipHome),
- DataBaseOAHelper.CreateInDbParameter("@in_TelHome", DbType.String, model.TelHome),
- DataBaseOAHelper.CreateInDbParameter("@in_Mobile", DbType.String, model.Mobile),
- DataBaseOAHelper.CreateInDbParameter("@in_IsHideMobile", DbType.Boolean, model.IsHideMobile),
- DataBaseOAHelper.CreateInDbParameter("@in_Bp", DbType.String, model.Bp),
- DataBaseOAHelper.CreateInDbParameter("@in_Email", DbType.String, model.Email),
- DataBaseOAHelper.CreateInDbParameter("@in_Oicq", DbType.String, model.Oicq),
- DataBaseOAHelper.CreateInDbParameter("@in_Icq", DbType.String, model.Icq),
- DataBaseOAHelper.CreateInDbParameter("@in_Msn", DbType.String, model.Msn),
- DataBaseOAHelper.CreateInDbParameter("@in_Skype", DbType.String, model.Skype),
- DataBaseOAHelper.CreateInDbParameter("@in_NickName", DbType.String, model.NickName),
- DataBaseOAHelper.CreateInDbParameter("@in_Avatar", DbType.Int32, model.Avatar),
- DataBaseOAHelper.CreateInDbParameter("@in_MenuType", DbType.Boolean, model.MenuType),
- DataBaseOAHelper.CreateInDbParameter("@in_MenuHide", DbType.Boolean, model.MenuHide),
- DataBaseOAHelper.CreateInDbParameter("@in_SmsOn", DbType.Boolean, model.SmsOn),
- DataBaseOAHelper.CreateInDbParameter("@in_CallSound", DbType.Int32, model.CallSound),
- DataBaseOAHelper.CreateInDbParameter("@in_Theme", DbType.Int32, model.Theme),
- DataBaseOAHelper.CreateInDbParameter("@in_Note", DbType.String, model.Note),
- DataBaseOAHelper.CreateInDbParameter("@in_MytableLeft", DbType.String, model.MytableLeft),
- DataBaseOAHelper.CreateInDbParameter("@in_MytableRight", DbType.String, model.MytableRight),
- DataBaseOAHelper.CreateInDbParameter("@in_EmailCapacity", DbType.Int32, model.EmailCapacity),
- DataBaseOAHelper.CreateInDbParameter("@in_FolderCapacity", DbType.Int32, model.FolderCapacity),
- DataBaseOAHelper.CreateInDbParameter("@in_OnlineTime", DbType.Single, model.OnlineTime),
- DataBaseOAHelper.CreateInDbParameter("@in_DutyType", DbType.Int32, model.DutyType),
- DataBaseOAHelper.CreateInDbParameter("@in_AttendCard", DbType.String, model.AttendCard),
- DataBaseOAHelper.CreateInDbParameter("@in_State", DbType.Int32, model.State),
- DataBaseOAHelper.CreateInDbParameter("@in_LastPassTime", DbType.String, model.LastPassTime),
- DataBaseOAHelper.CreateInDbParameter("@in_LastVisitTime", DbType.String, model.LastVisitTime),
- DataBaseOAHelper.CreateInDbParameter("@in_LastIp", DbType.String, model.LastIp),
- DataBaseOAHelper.CreateInDbParameter("@in_Disabled", DbType.Boolean, model.Disabled),
- DataBaseOAHelper.CreateInDbParameter("@in_BindIp", DbType.String, model.BindIp),
- DataBaseOAHelper.CreateInDbParameter("@in_UsingKey", DbType.Boolean, model.UsingKey),
- DataBaseOAHelper.CreateInDbParameter("@in_UGuid", DbType.String, model.UGuid),
- DataBaseOAHelper.CreateInDbParameter("@in_UKey", DbType.String, model.UKey),
- DataBaseOAHelper.CreateInDbParameter("@in_UExt", DbType.String, model.UExt),
- DataBaseOAHelper.CreateInDbParameter("@in_NotUser", DbType.Int32, model.NotUser),
- DataBaseOAHelper.CreateInDbParameter("@in_NotTable", DbType.Int32, model.NotTable),
- DataBaseOAHelper.CreateInDbParameter("@in_DefaultMenu", DbType.String, model.DefaultMenu),
- DataBaseOAHelper.CreateInDbParameter("@in_TablePhoto", DbType.String, model.TablePhoto),
- DataBaseOAHelper.CreateInDbParameter("@in_WebmailNum", DbType.Int32, model.WebmailNum),
- DataBaseOAHelper.CreateInDbParameter("@in_WebmailCapacity", DbType.Int32, model.WebmailCapacity),
- DataBaseOAHelper.CreateInDbParameter("@in_AdUserId", DbType.String, model.AdUserId),
- DataBaseOAHelper.CreateInDbParameter("@in_UsingAd", DbType.Boolean, model.UsingAd),
- DataBaseOAHelper.CreateInDbParameter("@in_Photo", DbType.AnsiString, model.Photo),
- DataBaseOAHelper.CreateInDbParameter("@in_EmailSite", DbType.AnsiString, model.EmailSite),
- DataBaseOAHelper.CreateInDbParameter("@in_Id", DbType.Int32, model.Id)};
- return DataBaseOAHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), cmdParms);
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- public int Delete(int Id)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("DELETE FROM Users ");
- strSql.Append(" WHERE Id=@in_Id");
- DbParameter[] cmdParms = {
- DataBaseOAHelper.CreateInDbParameter("@in_Id", DbType.Int32, Id)};
- return DataBaseOAHelper.ExecuteNonQuery(CommandType.Text, strSql.ToString(), cmdParms);
- }
- /// <summary>
- /// 得到最大ID
- /// </summary>
- public int GetMaxId()
- {
- object obj = DataBaseOAHelper.ExecuteScalar(CommandType.Text, "SELECT MAX(Id) FROM Users", null);
- return DataBaseOAHelper.GetInt(obj);
- }
- /// <summary>
- /// 是否存在该记录
- /// </summary>
- public bool Exists(int Id)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("SELECT COUNT(1) FROM Users");
- strSql.Append(" WHERE Id=@in_Id");
- DbParameter[] cmdParms = {
- DataBaseOAHelper.CreateInDbParameter("@in_Id", DbType.Int32, Id)};
- object obj = DataBaseOAHelper.ExecuteScalar(CommandType.Text, strSql.ToString(), cmdParms);
- return DataBaseOAHelper.GetInt(obj) > 0;
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public Model.Users GetModel(int Id)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("SELECT * FROM Users ");
- strSql.Append(" WHERE Id=@in_Id");
- DbParameter[] cmdParms = {
- DataBaseOAHelper.CreateInDbParameter("@in_Id", DbType.Int32, Id)};
- Model.Users model = null;
- using (DbDataReader dr = DataBaseOAHelper.ExecuteReader(CommandType.Text, strSql.ToString(), cmdParms))
- {
- while (dr.Read())
- {
- model = GetModel(dr);
- }
- return model;
- }
- }
- /// <summary>
- /// 获取泛型数据列表
- /// </summary>
- public List<Model.Users> GetList()
- {
- StringBuilder strSql = new StringBuilder("SELECT * FROM Users");
- using (DbDataReader dr = DataBaseOAHelper.ExecuteReader(CommandType.Text, strSql.ToString(), null))
- {
- List<Model.Users> lst = GetList(dr);
- return lst;
- }
- }
- /// <summary>
- /// 得到数据条数
- /// </summary>
- public int GetCount(string condition)
- {
- return DataBaseOAHelper.GetCount("Users", condition);
- }
- /// <summary>
- /// 分页获取泛型数据列表
- /// </summary>
- public List<Model.Users> GetPageList(int pageSize, int pageIndex, string fldSort, bool fldDir, string condition)
- {
- using (DbDataReader dr = DataBaseOAHelper.GetPageList("Users", pageSize, pageIndex, fldSort, fldDir, condition))
- {
- List<Model.Users> lst = GetList(dr);
- return lst;
- }
- }
- #region -------- 私有方法,通常情况下无需修改 --------
- /// <summary>
- /// 由一行数据得到一个实体
- /// </summary>
- private Model.Users GetModel(DbDataReader dr)
- {
- Model.Users model = new Model.Users();
- model.Id = DataBaseOAHelper.GetInt(dr["Id"]);
- model.UserId = DataBaseOAHelper.GetString(dr["UserId"]);
- model.UserId2 = DataBaseOAHelper.GetString(dr["UserId2"]);
- model.UserNo = DataBaseOAHelper.GetInt(dr["UserNo"]);
- model.UserName = DataBaseOAHelper.GetString(dr["UserName"]);
- model.Password = DataBaseOAHelper.GetString(dr["Password"]);
- model.PrivId = DataBaseOAHelper.GetInt(dr["PrivId"]);
- model.PrivId2 = DataBaseOAHelper.GetString(dr["PrivId2"]);
- model.PostPriv = DataBaseOAHelper.GetString(dr["PostPriv"]);
- model.PostDept = DataBaseOAHelper.GetString(dr["PostDept"]);
- model.DeptId = DataBaseOAHelper.GetInt(dr["DeptId"]);
- model.DeptId2 = DataBaseOAHelper.GetString(dr["DeptId2"]);
- model.CanBroadcast = DataBaseOAHelper.GetBool(dr["CanBroadcast"]);
- model.Sex = DataBaseOAHelper.GetBool(dr["Sex"]);
- model.Birthday = DataBaseOAHelper.GetDateTime(dr["Birthday"]);
- model.IsHideBirthday = DataBaseOAHelper.GetBool(dr["IsHideBirthday"]);
- model.TelNoDept = DataBaseOAHelper.GetString(dr["TelNoDept"]);
- model.FaxNoDept = DataBaseOAHelper.GetString(dr["FaxNoDept"]);
- model.AddressHome = DataBaseOAHelper.GetString(dr["AddressHome"]);
- model.ZipHome = DataBaseOAHelper.GetString(dr["ZipHome"]);
- model.TelHome = DataBaseOAHelper.GetString(dr["TelHome"]);
- model.Mobile = DataBaseOAHelper.GetString(dr["Mobile"]);
- model.IsHideMobile = DataBaseOAHelper.GetBool(dr["IsHideMobile"]);
- model.Bp = DataBaseOAHelper.GetString(dr["Bp"]);
- model.Email = DataBaseOAHelper.GetString(dr["Email"]);
- model.Oicq = DataBaseOAHelper.GetString(dr["Oicq"]);
- model.Icq = DataBaseOAHelper.GetString(dr["Icq"]);
- model.Msn = DataBaseOAHelper.GetString(dr["Msn"]);
- model.Skype = DataBaseOAHelper.GetString(dr["Skype"]);
- model.NickName = DataBaseOAHelper.GetString(dr["NickName"]);
- model.Avatar = DataBaseOAHelper.GetInt(dr["Avatar"]);
- model.MenuType = DataBaseOAHelper.GetBool(dr["MenuType"]);
- model.MenuHide = DataBaseOAHelper.GetBool(dr["MenuHide"]);
- model.SmsOn = DataBaseOAHelper.GetBool(dr["SmsOn"]);
- model.CallSound = DataBaseOAHelper.GetInt(dr["CallSound"]);
- model.Theme = DataBaseOAHelper.GetInt(dr["Theme"]);
- model.Note = DataBaseOAHelper.GetString(dr["Note"]);
- model.MytableLeft = DataBaseOAHelper.GetString(dr["MytableLeft"]);
- model.MytableRight = DataBaseOAHelper.GetString(dr["MytableRight"]);
- model.EmailCapacity = DataBaseOAHelper.GetInt(dr["EmailCapacity"]);
- model.FolderCapacity = DataBaseOAHelper.GetInt(dr["FolderCapacity"]);
- model.OnlineTime = DataBaseOAHelper.GetFloat(dr["OnlineTime"]);
- model.DutyType = DataBaseOAHelper.GetInt(dr["DutyType"]);
- model.AttendCard = DataBaseOAHelper.GetString(dr["AttendCard"]);
- model.State = DataBaseOAHelper.GetInt(dr["State"]);
- model.LastPassTime = DataBaseOAHelper.GetDateTime(dr["LastPassTime"]);
- model.LastVisitTime = DataBaseOAHelper.GetDateTime(dr["LastVisitTime"]);
- model.LastIp = DataBaseOAHelper.GetString(dr["LastIp"]);
- model.Disabled = DataBaseOAHelper.GetBool(dr["Disabled"]);
- model.BindIp = DataBaseOAHelper.GetString(dr["BindIp"]);
- model.UsingKey = DataBaseOAHelper.GetBool(dr["UsingKey"]);
- model.UGuid = DataBaseOAHelper.GetString(dr["UGuid"]);
- model.UKey = DataBaseOAHelper.GetString(dr["UKey"]);
- model.UExt = DataBaseOAHelper.GetString(dr["UExt"]);
- model.NotUser = DataBaseOAHelper.GetInt(dr["NotUser"]);
- model.NotTable = DataBaseOAHelper.GetInt(dr["NotTable"]);
- model.DefaultMenu = DataBaseOAHelper.GetString(dr["DefaultMenu"]);
- model.TablePhoto = DataBaseOAHelper.GetString(dr["TablePhoto"]);
- model.WebmailNum = DataBaseOAHelper.GetInt(dr["WebmailNum"]);
- model.WebmailCapacity = DataBaseOAHelper.GetInt(dr["WebmailCapacity"]);
- model.AdUserId = DataBaseOAHelper.GetString(dr["AdUserId"]);
- model.UsingAd = DataBaseOAHelper.GetBool(dr["UsingAd"]);
- model.Photo = DataBaseOAHelper.GetString(dr["Photo"]);
- model.EmailSite = DataBaseOAHelper.GetString(dr["EmailSite"]);
- return model;
- }
- /// <summary>
- /// 由DbDataReader得到泛型数据列表
- /// </summary>
- private List<Model.Users> GetList(DbDataReader dr)
- {
- List<Model.Users> lst = new List<Model.Users>();
- while (dr.Read())
- {
- lst.Add(GetModel(dr));
- }
- return lst;
- }
- #endregion
- }
- }