示例#1
0
        private void frmHotelEditor_Load(object sender, EventArgs e)
        {
            BindCities();

            /* Here: we need functions to add and remove room types, update contract valid date
             * to available date in season */
            if (_hotel.HotelId != 0)
            {
                BindDetailData();
                btnAction.Text         = "Update";
                btnDelete.Enabled      = true;
                txtMinCutOffDates.Text = _hotel.MinCutOffDates.ToString();

                dtContractValidTo.Value   = _hotel.ContractValidTo;
                dtContractValidFrom.Value = DateTime.UtcNow;
                var city = ctbo.GetCity(_hotel.CityId);
                cmbCities.SelectedIndex = cmbCities.FindString(city.CityName);
                dgRoomTypes.Enabled     = true;
            }
            else
            {
                dtContractValidFrom.Value = dtContractValidTo.Value = DateTime.UtcNow.AddDays(-1);
                txtMinCutOffDates.Text    = "1";
                btnAction.Text            = "Add";
                btnDelete.Enabled         = false;
            }
        }
示例#2
0
 public frmCityEditor(int id)
 {
     InitializeComponent();
     cbo   = new BO.CityBO();
     _city = cbo.GetCity(id);
 }