酒店管理系统房预订计算 [英] Hotel Management System room Booking calculation
问题描述
这是Bala,我是.net窗口应用程序的新手。我正在使用.net framework 3.5与c#语言和sql server 2005现在我正在开发一个窗口应用程序中的酒店管理项目。模块是,预订房间,并根据时间而不是白天腾出房间。现在我已经通过减少数据库中的房间数量来完成房间预订。我怀疑是根据时间腾出房间。
客户要求是,
1)如果客户在24小时停留意味着,必须被视为1天。
2)如果客户在25小时停留意味着,那必须被视为1天。
3)如果客户住在超过25小时意味着,应该被视为2天。
任何人都可以为我帮助????
Hi,
This is Bala, i am very new to .net window applications. i am using .net framework 3.5 with c# language and sql server 2005 now i am developing a project for hotel management in window application. modules are, booking of room and vacate a room based on the time not day. now i have completed booking of room by reducing number of rooms in database. my doubt is vacate a room based on the time.
customer request is,
1) if a customer stayed at 24 hours means, that must be considered as 1 day.
2) if a customer stayed at 25 hours means, that must be considered as 1 day.
3) if a customer stayed at more than 25 hours means, that should be considered as 2 days.
can anyone help for me????
推荐答案
尝试:
Try:
DateTime startBooking = ...
DateTime vacated = DateTime.Now;
TimeSpan roomHeldFor = vacated - startBooking;
int heldTime = (int) roomHeldFor.TotalMinutes;
Console.WriteLine(heldTime > (25 * 60) ? "Two days" : "One day");
通常人们必须在13:00之前离开房间,否则将其存入他们的帐户。
Usually people must vacate the room before 13:00 otherwise it is put on their account.
int Days = 0;
DateTime bookingTime = ----;
DateTime vacateTime = ---;
TimeSpan roomHeldFor = vacateTime - bookingTime;
decimal heldTime = Math.Ceiling(((decimal)roomHeldFor.TotalHours));
if(heldTime< = 25)
{
天= 1;
}
其他
{
int D1 = Convert.ToInt32(Math.Floor(Convert.ToDecimal(heldTime / 24)));
decimal remainingHours = holdTime%24;
if(remainingHours> 1 )
{
天= D1 + 1;
}
其他
{
天= D1;
}
}
int Days = 0;
DateTime bookingTime = ----;
DateTime vacateTime = ---;
TimeSpan roomHeldFor = vacateTime - bookingTime;
decimal heldTime = Math.Ceiling(((decimal)roomHeldFor.TotalHours));
if (heldTime <= 25)
{
Days = 1;
}
else
{
int D1 = Convert.ToInt32(Math.Floor(Convert.ToDecimal(heldTime / 24)));
decimal remainingHours = heldTime % 24;
if (remainingHours > 1)
{
Days = D1 + 1;
}
else
{
Days = D1;
}
}
这篇关于酒店管理系统房预订计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!