• 大小: 4.13MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-18
  • 语言: 其他
  • 标签: .net  

资源简介

简单酒店管理系统,基于.net+vs2010.

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;

using System.Collections;
using System.Data.OleDb;
using System.Data;
using IDAL;
using Model;
using DBUtility;

namespace AccessDAL
{
    public class AccessHotelUserService:IHotelUser
    {
        #region IHotelUser 成员

        private AccessRoomTypeOperatorService roomTypeOp = new AccessRoomTypeOperatorService();//操作房间类型的数据访问层类
        private const string PARM_ACCOUNT_ID = “@accountID“; //声明一个参数
        private const string PARM_PAW = “@paw“;

        /// 
        /// 按用户名得到用户密码(验证登录用户的合法性)
        /// 

        /// 
        /// 
        public string GetUserPasswordByUserName(string userName)
        {
            StringBuilder sql = new StringBuilder();
            string str = string.Empty;
            sql.Append(“select Paw from HotelUser where AccountID=‘“ + userName + “‘“);
            try
            {
                string temp = AccessHelper.ExecuteScalar(AccessHelper.AccessConnString CommandType.Text sql.ToString() null);
                if (!string.IsNullOrEmpty(temp))
                    str = temp;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return str;
        }

        /// 
        /// 添加新用户
        /// 

        /// 
        /// 
        public bool AddUser(HotelUser user)
        {
            StringBuilder add = new StringBuilder();
            add.Append(“insert into HotelUser(AccountIDPaw) values(“);
            add.Append(PARM_ACCOUNT_ID + ““);
            add.Append(PARM_PAW + “)“);
            int line = 0;
            try
            {
                OleDbParameter[] parms = new OleDbParameter[2];
                parms[0] = new OleDbParameter(PARM_ACCOUNT_ID OleDbType.VarChar);
                parms[1] = new OleDbParameter(PARM_PAW OleDbType.VarChar);
                parms[0].Value = user.UserName;
                parms[1].Value = user.PassWord;

                line = AccessHelper.ExecuteNonQuery(AccessHelper.AccessConnString add.ToString() CommandType.Text parms);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            if (line > 0)
                return true;
            else
                return false;
        }

        /// 
        /// 获得所有的用户信息
        /// 

        /// 
        public IList GetAllUsers()
        {
            StringBuilder sel = new StringBuilder();
            sel.Append(“select AccountIDPaw from HotelUser“);
            IList lists = new List();
            try
            {
                OleDbDataReader rdr = AccessHelper.ExecuteReader(AccessHelper.AccessConnString CommandType.Text sel.ToString()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-12-23 15:18  HotelManagerWeb\
     文件        2157  2009-04-02 09:25  HotelManagerWeb\51aspx源码必读.txt
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\
     文件        2913  2013-12-23 15:06  HotelManagerWeb\AccessDAL\AccessDAL.csproj
     文件        3681  2008-09-10 17:55  HotelManagerWeb\AccessDAL\AccessHotelUserService.cs
     文件       17948  2008-09-10 18:32  HotelManagerWeb\AccessDAL\AccessRoomOperatorService.cs
     文件       12866  2008-08-14 12:31  HotelManagerWeb\AccessDAL\AccessRoomTypeOperatorService.cs
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\bin\
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\bin\Debug\
     文件       18944  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\AccessDAL.dll
     文件       36352  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\AccessDAL.pdb
     文件        7168  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\DBUtility.dll
     文件       19968  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\DBUtility.pdb
     文件        5120  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\IDAL.dll
     文件        7680  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\IDAL.pdb
     文件        6144  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\Model.dll
     文件       26112  2013-12-23 15:06  HotelManagerWeb\AccessDAL\bin\Debug\Model.pdb
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\obj\
     文件         274  2008-09-10 18:58  HotelManagerWeb\AccessDAL\obj\AccessDAL.csproj.FileList.txt
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\obj\Debug\
     文件         813  2013-12-23 15:06  HotelManagerWeb\AccessDAL\obj\Debug\AccessDAL.csproj.FileListAbsolute.txt
     文件       18944  2013-12-23 15:06  HotelManagerWeb\AccessDAL\obj\Debug\AccessDAL.dll
     文件       36352  2013-12-23 15:06  HotelManagerWeb\AccessDAL\obj\Debug\AccessDAL.pdb
     文件        5240  2013-12-23 15:06  HotelManagerWeb\AccessDAL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\obj\Debug\Refactor\
     文件       16384  2008-09-10 18:19  HotelManagerWeb\AccessDAL\obj\Debug\Refactor\AccessDAL.dll
     文件        6716  2013-12-23 15:06  HotelManagerWeb\AccessDAL\obj\Debug\ResolveAssemblyReference.cache
     目录           0  2009-04-02 09:12  HotelManagerWeb\AccessDAL\obj\Debug\TempPE\
     目录           0  2013-12-23 15:18  HotelManagerWeb\AccessDAL\Properties\
     文件        1337  2008-06-22 12:12  HotelManagerWeb\AccessDAL\Properties\AssemblyInfo.cs
     目录           0  2013-12-23 15:18  HotelManagerWeb\Backup\
............此处省略559个文件信息

评论

共有 条评论