房台数据回填
-----------------------------------------------------------------------------------
开发工具与关键技术:VS..NET MVC 作者:纳兹, 撰写日期:2019.07.27,
-----------------------------------------------------------------------------------
以东方之星酒店管理系统为例子。
房台图数据的回填:查询出需要回填的数据:首先查询出需要回填的房台。根据房台号查询出需要回填的房台ID,查询出一条:
var listtb = (from tbCustomer in myModels.PW_Tenement
where tbCustomer.TenementNuber == TenementID
select tbCustomer).Single();
接着连表查询出其他表格中需要回填的数据:
var listTenementNuber = (from tbTenementNuber in myModels.PW_Tenement
join tbSubscriber in myModels.PW_Subscriber on tbTenementNuber.TenementID equals tbSubscriber.TenementID
join tbCustomer in myModels.PW_Customer on tbSubscriber.CustomerID equals tbCustomer.CustomerID
join tbOperational in myModels.S_Operational on tbCustomer.OperationalID equals tbOperational.OperationalID
join tbProtocol in myModels.PW_Protocol on tbCustomer.ProtocolID equals tbProtocol.ProtocolID
where tbTenementNuber.TenementID == listtb.TenementID
select new CustomerVo
{
TenementID = tbTenementNuber.TenementID,
TenementName = tbTenementNuber.TenementName,
TenementNuber = tbTenementNuber.TenementNuber,
Discount = tbTenementNuber.Discount,
CustomerNuber = tbCustomer.CustomerNuber,
OddNumber = tbCustomer.OddNumber,
Peoples = tbCustomer.Peoples,
Ahalf = tbCustomer.Ahalf,
Historry = tbCustomer.Historry,
Remarked = tbCustomer.Remarked,
time = tbCustomer.DeskTime.ToString(),
OperationalID = tbOperational.OperationalID,
Operational = tbOperational.Operational,
ProtocolID = tbProtocol.ProtocolID,
ProtocolUnit = tbProtocol.ProtocolUnit,
}).Single();
用join连接订单表、顾客表、市别表、协议单位表查询出页面所需要显示的数据,查询出需要回填的房台(房台名称、房台号、折扣时间等),查询出一条数据。在页面进行post提交进行数据回填,下拉框数据回填和其他表单数据回填(createSelect(“KProtocolID”, “selectProl”, data.ProtocolID)、loadDatatoForm(“formReservationAllInfo”, data);),然后进行表格数据的回填,tabcol.reload({
url: “selectConsumptionInof”,
where: { TenementID: TenementIDS },
})
以上为房台数据的回填,页面如下图显示。