private void btn_Delete_RoomType_Click(object sender, EventArgs e) { BLRoomType blRT = new BLRoomType(); blRT.DeleteRoomType(txt_RoomType_RoomTypeID.Text); dgv_RoomType.DataSource = blRT.LoadRoomType(); dgv_RoomType_CellClick(null, null); }
private void btn_Save_RoomType_Click(object sender, EventArgs e) { BLRoomType blRT = new BLRoomType(); if (SaveStatus == 1) { blRT.CreateRoomType(txt_RoomType_RoomTypeName.Text, txt_RoomType_Price.Text); } else if (SaveStatus == 2) { blRT.UpdateRoomType(Convert.ToInt32(txt_RoomType_RoomTypeID.Text), txt_RoomType_RoomTypeName.Text, txt_RoomType_Price.Text); } SaveStatus = 0; dgv_RoomType.DataSource = blRT.LoadRoomType(); dgv_RoomType_CellClick(null, null); btn_Update_RoomType.Enabled = true; btn_Create_RoomType.Enabled = true; btn_Save_RoomType.Enabled = false; }
private void btn_RoomType_Click(object sender, EventArgs e) { TabControl_Main.TabPages.Clear(); TabControl_Main.TabPages.Add(TabPage_RoomType); dgv_RoomType.AutoResizeColumns(); BLRoomType dbRT = new BLRoomType(); var data = dbRT.LoadRoomType(); if (data != null) { dgv_RoomType.DataSource = data; } else { dgv_RoomType.DataSource = null; } dgv_RoomType_CellClick(null, null); txt_RoomType_RoomTypeID.Enabled = false; }