BLL/RoomTypeBLL.cs

(开头部分) 4KB

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

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


namespace BLL
{
    public class RoomTypeBLL
    {
        private DataSet ds;
        RoomTypeDAO dao = new RoomTypeDAO();
        JSONHelper json = new  JSONHelper();
        

        //将DataSet 转换为JSON数据
        public string getRoomTypeInfo(int start,int limit)
        {
            ds = dao.getAllRoomTypeInfo(start,limit);
            json.success = true;
           
            foreach(DataRow dr in ds.Tables[0].Rows)
            {
                json.AddItem("typeid",dr["typeid"].ToString());
                json.AddItem("typename", dr["typename"].ToString());
                json.AddItem("typeprice", dr["typeprice"].ToString());
                json.AddItem("typeaddbed", dr["typeaddbed"].ToString());
                json.AddItem("addbed", dr["addbed"].ToString());
                json.AddItem("typedesc", dr["typedesc"].ToString());
                json.ItemOk();
            }
            json.totlalCount = dao.getInfoCount();
            string jsons = "";
            if (json.totlalCount > 0)
            {
                jsons = json.ToString();
            }
            else
            {
                jsons = @"{success:false}";
            }
            return jsons;
        }

        //删除房间信息
        public int DeleteRoomTypeInfo(int typeid)
        {
            return dao.DeleteRoomTypeInfo(typeid);
        }

        //根据typeid查类型信息
        public string getRoomTypeInfo(int typeid)
        {
         
            FormJSONHelper json = new FormJSONHelper();
            ds = dao.GetTypeInfoByTypeid(typeid);
            json.success = true;
            foreach(DataRow dr in ds.Tables[0].Rows)
后面还有 76 行代码,解锁后查看完整代码

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

AI 解读

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

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