private void Btn_Create_Click(object sender, EventArgs e) { MyResources.Main.SetCursorLoading(); var text = Tbox_NameCreate.Text.Trim(); if (text == "") { MyResources.Main.SetCursorDefault(); MessageBox.Show("Name is null !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int id = MyResources.Resources.InsertPlaylist(text); if (id < 0) { MyResources.Main.SetCursorDefault(); MessageBox.Show("Name is duplicate !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { var r = new RowPlaylist(); r.SetData(text, id.ToString()); FlowPanel_ListPlaylist.Controls.Add(r); } Lb_ColNameListPlaylist.Focus(); MyResources.Main.SetCursorDefault(); }
public void LoadAllPlaylist() { MyResources.Main.SetCursorLoading(); FlowPanel_ListPlaylist.Controls.Clear(); foreach (var i in MyResources.Resources.ListPlaylists) { if (i.ID == 0) { continue; } var r = new RowPlaylist(); r.SetData(i.Title, i.ID.ToString()); FlowPanel_ListPlaylist.Controls.Add(r); } MyResources.Main.SetCursorDefault(); }