Example #1
0
        public void initializeData()
        {
            try
            {
                conn.Open();
                MySqlCommand     comm = new MySqlCommand("SELECT * FROM room WHERE id =" + roomId, conn);
                MySqlDataAdapter adp  = new MySqlDataAdapter(comm);
                DataTable        dt   = new DataTable();
                adp.Fill(dt);

                if (dt.Rows.Count > 0)
                {
                    txtRoomNumber.Text = dt.Rows[0]["roomNumber"].ToString();
                    roomTypeId         = dt.Rows[0]["roomTypeId"].ToString();
                    cmbFloor.Text      = dt.Rows[0]["floorLevel"].ToString();
                    txtDesc.Text       = dt.Rows[0]["description"].ToString();
                }

                conn.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show("Nah!" + ee);
                conn.Close();
            }
            RoomDataService myRoomDataServ = new RoomDataService();

            RoomTypeInfo lesbian = new RoomTypeInfo();

            MessageBox.Show(roomTypeId.ToString());
            //string why =
            lesbian = myRoomDataServ.getRoomTypeByInt(Convert.ToInt32(roomTypeId));
            MessageBox.Show(lesbian.TypeName);
            cmbRoomType.Text = lesbian.TypeName;
        }
Example #2
0
        private void cmbRoomTypes_SelectedIndexChanged(object sender, EventArgs e)
        {
            RoomDataService myRoomDataService = new RoomDataService();
            RoomTypeInfo    myRoomTypeInfo    = new RoomTypeInfo();

            myRoomTypeInfo = myRoomDataService.getRoomTypeByName(cmbRoomTypes.Text);
            TypeId         = myRoomTypeInfo.TypeId;
        }