السلام عليكم
اريد أن اعمل نظام حجز فنادق وعندي استفسار بخصوص Basic date baker
حيث انني اريد ان اختار موعد تاريخ الدخول وتاريخ الخروج بحيث ان احسب المدة التي سيقيم فيها العميل في الفندق حتى اضرب عدد الايام التي سيقيم فيها بسعر الغرفة
ولكني اجد صعوبة في برمجة ذلك
هذه محاولتي
protected void LinkButton5_Click(object sender, EventArgs e)
{
int period2 = Convert.ToInt32(BasicDatePicker2.SelectedDate);
int period1 =Convert.ToInt32( BasicDatePicker1.SelectedDate);
int period = period2 - period1;
int price = Convert.ToInt32(RadioButtonList2.SelectedValue);
if (DropDownList1.SelectedIndex == 1)
{
price = price * period * 1;
}
else if (DropDownList1.SelectedIndex == 2)
{
price = (1 * Convert.ToInt32(RadioButtonList2.SelectedValue)) * period + (1 * Convert.ToInt32(RadioButtonList4.SelectedValue)) * period;
}
else if (DropDownList1.SelectedIndex == 3)
{
price = (1 * Convert.ToInt32(RadioButtonList2.SelectedValue)) * period + (1 * Convert.ToInt32(RadioButtonList4.SelectedValue)) + (1 * Convert.ToInt32(RadioButtonList5.SelectedValue)) * period;
}