http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 3761|回复: 2

[其他] C# 去数据库信息的问题

[复制链接]
发表于 2014-4-28 17:40:24 | 显示全部楼层 |阅读模式
1金钱

这段代码运行后,页面显示的信息不符,请高人指教!


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ChangeForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Maticsoft.BLL.RoomSales bll1 = new Maticsoft.BLL.RoomSales();
            drpRoom.DataSource = bll1.GetListNoChk();
            drpRoom.DataTextField = "RoomName";
            drpRoom.DataValueField = "id";
            drpRoom.DataBind();

            Maticsoft.BLL.Room bll = new Maticsoft.BLL.Room();
            DropDownList1.DataSource = bll.GetNoRoom();
            DropDownList1.DataTextField = "RoomName";
            DropDownList1.DataValueField = "id";
            DropDownList1.DataBind();
        }
    }
    //更改入住变成空房
    private void UpdateroomStateNO()
    {   string id = Hidden1.Value;
        Maticsoft.Model.Room model = new Maticsoft.Model.Room();
        model.RoosIs = "空房";
        model.id = int.Parse(id);
        Maticsoft.BLL.Room bll = new Maticsoft.BLL.Room();
        bll.Update(model);
    }
    // 更改空房变成入住
    private void UpdateroomStateIn()
    {   string id = DropDownList1.SelectedValue;
        Maticsoft.Model.Room model = new Maticsoft.Model.Room();
        model.RoosIs = "已入住";
        model.id = int.Parse(id);
        Maticsoft.BLL.Room bll = new Maticsoft.BLL.Room();
        bll.Update(model);
    }
    // 更改销售表中换过之后的房间编号和房间信息
    private void UpdateRoomUserId()
    {
        string RoomName = this.DropDownList1.SelectedItem.Text;
        int RoomId = int.Parse(this.DropDownList1.SelectedValue);     
        Maticsoft.Model.RoomSales model = new Maticsoft.Model.RoomSales();
        model.RoomName = RoomName;
        model.RoomId = RoomId;
        model.id = int.Parse(drpRoom.SelectedValue);

        Maticsoft.BLL.RoomSales bll = new Maticsoft.BLL.RoomSales();
        bll.Update(model);
    }
    // 插入换房记录
    private void InsertWardsRoom()
    {
        int FRoomId = int.Parse(Hidden1.Value);
        int TRoomId = int.Parse(DropDownList1.SelectedValue);
        string UserName = Hidden2.Value;

        Maticsoft.Model.WardsRoom model = new Maticsoft.Model.WardsRoom();
        model.FRoomId = FRoomId;
        model.TRoomId = TRoomId;
        model.UserName = UserName;

        Maticsoft.BLL.WardsRoom bll = new Maticsoft.BLL.WardsRoom();
        bll.Add(model);
    }
    protected void IbnOk_Click(object sender, ImageClickEventArgs e)
    {
        UpdateroomStateNO();
        UpdateroomStateIn();
        UpdateRoomUserId();
        InsertWardsRoom();
        Maticsoft.DBUtility.js.AlertAndRedirect("操作成功!", "RegisterForm.aspx");
    }
    protected void drpRoom_SelectedIndexChanged(object sender, EventArgs e)
    {
        ShowInfo(int.Parse(drpRoom.SelectedValue));
        ShowRoomIdInfo(int.Parse(drpRoom.SelectedValue));
    }
    private void ShowInfo(int id)
    {
        Maticsoft.BLL.Member bll = new Maticsoft.BLL.Member();
        Maticsoft.Model.Member model = bll.GetModel(id);

        this.txtUserName.Text = model.UserName;
        this.txtUserMobile.Text = model.UserMobile;
        this.txtUserCard.Text = model.UserCard;
        this.txtUserSex.Text = model.UserSex;
    }
    //获取要换房的房间编号
    private void ShowRoomIdInfo(int id)
    {
        Maticsoft.BLL.RoomSales bll = new Maticsoft.BLL.RoomSales();
        Maticsoft.Model.RoomSales model = bll.GetModel(id);
        Hidden2.Value = model.UserId.ToString();
        this.Hidden1.Value = model.RoomId.ToString();
    }
}



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2014-4-28 19:28:20 | 显示全部楼层
不符,是什么意思,错误,不是乱了。还是怎么的。光看代码看不出什么
回复

使用道具 举报

 楼主| 发表于 2014-4-29 12:18:04 | 显示全部楼层
站长苏飞 发表于 2014-4-28 19:28
不符,是什么意思,错误,不是乱了。还是怎么的。光看代码看不出什么

比如,A顾客入住了101房间,可是页面上显示101房间的顾客是B
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-5-3 16:52

© 2014-2021

快速回复 返回顶部 返回列表