예제 #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (txtId.Text == string.Empty)
            {
                MessageBox.Show("You don't choose a room type to edit!", "Infomations", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                RoomType rt = new RoomType()
                {
                    Id = txtId.Text,
                    Name = txtName.Text,
                    Price = decimal.Parse(txtPrice.Text.Trim()),
                    Deposit = decimal.Parse(txtDeposit.Text.Trim()),
                    Note = txtNote.Text
                };

                RoomTypeEdit roomTypeEdit = new RoomTypeEdit(rt);
                roomTypeEdit.EditCompletedHandler += FormRoomTypeEdit_Completed;
                roomTypeEdit.ShowDialog();
            }
        }
예제 #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     RoomTypeEdit roomTypeEdit = new RoomTypeEdit();
     roomTypeEdit.EditCompletedHandler += FormRoomTypeEdit_Completed;
     roomTypeEdit.ShowDialog();
 }