private void btn_Insert_Click(object sender, EventArgs e) { String u = textBox2.Text; String d = textBox3.Text; String r = textBox4.Text; if (String.IsNullOrEmpty(u) || String.IsNullOrEmpty(d) || String.IsNullOrEmpty(r)) { MessageBox.Show("It's empty"); return; } cls_room = cls_rooms.Insert(u, d, r, "Free"); load_All(); }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { if (listView_rooms.SelectedItems.Count > 0) { ListViewItem item = listView_rooms.SelectedItems[0]; cls_room = (cls_rooms)item.Tag; get_id = cls_room.Id; String n = cls_room.Name; String d = cls_room.Descri; float r = cls_room.Rate; String s = cls_room.Status; textBox1.Text = n; textBox2.Text = d; textBox3.Text = r.ToString(); comboBox1.Text = s; } }