private void btnSearchHotel_Click(object sender, EventArgs e) { AdminBusinessAccessClass bac = new AdminBusinessAccessClass(); DataSet ds = bac.getHotelDetailByHotelId(txtHotelId.Text); if (ds != null) { txtHotelName.Text = ds.Tables[0].Rows[0]["Hotel_Name"].ToString(); txtCountry.Text = ds.Tables[0].Rows[0]["Country_Name"].ToString(); txtCity.Text = ds.Tables[0].Rows[0]["City_Name"].ToString(); txtHotelDesc.Text = ds.Tables[0].Rows[0]["Hotel_Description"].ToString(); txtNumAcRooms.Text = ds.Tables[0].Rows[0]["No_Of_Ac_Room"].ToString(); txtNumNonAcRooms.Text = ds.Tables[0].Rows[0]["No_Of_Non_Ac_Room"].ToString(); txtRateChildAc.Text = ds.Tables[0].Rows[0]["Rate_Child_Ac"].ToString(); txtRateChildNonAc.Text = ds.Tables[0].Rows[0]["Rate_Child_Non_Ac"].ToString(); txtRateAdultAc.Text = ds.Tables[0].Rows[0]["Rate_Adult_Ac"].ToString(); txtRateAdultNonAc.Text = ds.Tables[0].Rows[0]["Rate_Adult_Non_Ac"].ToString(); } else if (ds == null) { MessageBox.Show("Please Enter Correct Hotel_Id"); } }
private void btnSearch_Click(object sender, EventArgs e) { if (txtHotelId.Text == "") { MessageBox.Show("Please Enter HotelId"); } else { AdminBusinessAccessClass bac = new AdminBusinessAccessClass(); DataSet ds = bac.getHotelDetailByHotelId(txtHotelId.Text); if (ds != null) { txtHotelName.Text = ds.Tables[0].Rows[0]["Hotel_Name"].ToString(); lblCountryVal.Text = ds.Tables[0].Rows[0]["Country_Name"].ToString(); lblCityVal.Text = ds.Tables[0].Rows[0]["City_Name"].ToString(); txtHotelDesc.Text = ds.Tables[0].Rows[0]["Hotel_Description"].ToString(); txtNumAcRooms.Text = ds.Tables[0].Rows[0]["No_Of_Ac_Room"].ToString(); txtNumNonAcRooms.Text = ds.Tables[0].Rows[0]["No_Of_Non_Ac_Room"].ToString(); txtRateChildAc.Text = ds.Tables[0].Rows[0]["Rate_Child_Ac"].ToString(); txtRateChildNonAc.Text = ds.Tables[0].Rows[0]["Rate_Child_Non_Ac"].ToString(); txtRateAdultAc.Text = ds.Tables[0].Rows[0]["Rate_Adult_Ac"].ToString(); txtRateAdultNonAc.Text = ds.Tables[0].Rows[0]["Rate_Adult_Non_Ac"].ToString(); pictureBox1.ImageLocation = "C:\\ToolStripItemImageScaling\\" + ds.Tables[0].Rows[0]["Hotel_Image"].ToString(); lblTotalRoomsVal.Text = (Convert.ToInt32(txtNumAcRooms.Text) + Convert.ToInt32(txtNumNonAcRooms.Text)).ToString(); lblHotelIdVal.Text = txtHotelId.Text; txtRateAdultAc.Enabled = false; txtRateAdultNonAc.Enabled = false; txtRateChildAc.Enabled = false; txtRateChildNonAc.Enabled = false; } else if (ds == null) { MessageBox.Show("Please Enter Correct Hotel_Id"); } } }