コード例 #1
0
        private void Admin_EditHotel_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.None;
            var source = new AutoCompleteStringCollection();

            AdminBusinessAccessClass bac = new AdminBusinessAccessClass();
            DataSet ds = bac.getAllHotelId();

            if (ds != null)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    source.Add(ds.Tables[0].Rows[i][0].ToString());
                    // MessageBox.Show(ds.Tables[0].Rows[i][0].ToString());
                }
            }
            txtHotelId.AutoCompleteCustomSource = source;
            txtHotelId.AutoCompleteSource       = AutoCompleteSource.CustomSource;
        }
コード例 #2
0
 private void btnDeleteHotel_Click(object sender, EventArgs e)
 {
     if (txtHotelName != null && txtHotelId.Text != null)
     {
         if (MessageBox.Show("Are You Sure You Want To Delete Hotel : " + txtHotelId.Text + "?", "Confirm Deletion", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             AdminBusinessAccessClass bac = new AdminBusinessAccessClass();
             int i = bac.deleteHotel(txtHotelId.Text);
             if (i > 0)
             {
                 MessageBox.Show("Hotel Details Of Hotel : " + txtHotelId.Text + "Deleted Successfully");
             }
             else
             {
                 MessageBox.Show("Deletion Unsucessful. Try Later...");
             }
         }
     }
     else
     {
         MessageBox.Show("First Select Hotel For Deletion");
     }
 }
コード例 #3
0
        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");
            }
        }
コード例 #4
0
 private void btnUpdateDetail_Click(object sender, EventArgs e)
 {
     if (txtHotelName.Text == "" || txtNumAcRooms.Text == "" || txtNumNonAcRooms.Text == "" || txtRateAdultAc.Text == "" || txtRateAdultNonAc.Text == "" || txtRateChildAc.Text == "" || txtRateChildNonAc.Text == "")
     {
         MessageBox.Show("Validation Failed");
     }
     else if (!erpHotelName.GetError(txtHotelName).Equals("") || !erpHotelDescription.GetError(txtHotelDesc).Equals("") || !erpNoAcRoom.GetError(txtNumAcRooms).Equals("") || !erpRateNonAcAdult.GetError(txtRateAdultNonAc).Equals("") || !erpRateAcAdult.GetError(txtRateAdultAc).Equals("") || !erpNoNonAcRoom.GetError(txtNumNonAcRooms).Equals("") || !erpRateNonAcAdult.GetError(txtRateChildNonAc).Equals("") || !erpRateAcChild.GetError(txtRateChildAc).Equals(""))
     {
         MessageBox.Show("Validation Failed");
     }
     else
     {
         AdminBusinessAccessClass bac = new AdminBusinessAccessClass();
         int i = bac.updateHotelDetail(txtHotelId.Text, txtHotelName.Text, txtHotelDesc.Text, Convert.ToInt32(txtNumAcRooms.Text), Convert.ToInt32(txtNumNonAcRooms.Text), Convert.ToInt32(txtRateAdultAc.Text), Convert.ToInt32(txtRateAdultNonAc.Text), Convert.ToInt32(txtRateChildAc.Text), Convert.ToInt32(txtRateChildNonAc.Text));
         if (i == 1)
         {
             MessageBox.Show("Hotel Details Updated Successfully");
         }
         else
         {
             MessageBox.Show("Hotel Details Not Updated Successfully");
         }
     }
 }
コード例 #5
0
 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");
         }
     }
 }