Backup/DAL/GuestInfoDAO.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using Model;
using System.Data.SqlClient;
using System.Data;

namespace DAL
{
    public class GuestInfoDAO
    {
        SQLHelper sqlhelper = new SQLHelper();
        private DataSet ds;
        private SqlParameter para;

        //保存客人信息
        public int SaveGuestInfo(GuestInfoBean guest)
        {
            int count = 0;
            try
            {
                SqlParameter [] sp={
                    para = new SqlParameter("@GuestCardID",guest.GuestCardID),
                    para =new SqlParameter("@GuestName",guest.GuestName),
                    para =new SqlParameter("@GuestSex",guest.GuestSex),
                    para =new SqlParameter("@GuestMobile",guest.GuestMobile),
                    para =new SqlParameter("@GuestAddress",guest.GuestAddress)
                };
                count = sqlhelper.RunProc("proc_AddGuestInfo", sp);
            }
            catch (Exception)
            {
                
                throw;
            }
            return count;
        }

        //查询客人信息总记录
        public int GetGuestInfoCount()
        {
            try
            {
                int count = sqlhelper.ReturnSQL("select count(*) from guestinfo");
                return count;
            }
            catch (Exception)
            {
                
                throw;
            }
        
        }

        //分页查询客人信息
        public DataSet GetGuestInfo(int start,int limit)
        {
            try
            {
                ds = sqlhelper.GetDataSet("select top " + limit + " * from guestinfo where guestid not in(select top " + start + " guestid from guestinfo order by guestid asc) order by guestid asc");
后面还有 43 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。