/// <summary> /// Deprecated Method for adding a new object to the waitsongs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTowaitsongs(waitsong waitsong) { base.AddObject("waitsongs", waitsong); }
/// <summary> /// Create a new waitsong object. /// </summary> /// <param name="id_waitsong">Initial value of the id_waitsong property.</param> /// <param name="name_waitsong">Initial value of the name_waitsong property.</param> /// <param name="author_waitsong">Initial value of the author_waitsong property.</param> /// <param name="id_category">Initial value of the id_category property.</param> public static waitsong Createwaitsong(global::System.Int32 id_waitsong, global::System.String name_waitsong, global::System.String author_waitsong, global::System.Int32 id_category) { waitsong waitsong = new waitsong(); waitsong.id_waitsong = id_waitsong; waitsong.name_waitsong = name_waitsong; waitsong.author_waitsong = author_waitsong; waitsong.id_category = id_category; return waitsong; }
//метод за додавање на песна во листата на чекање public bool AddWaitSong(String _author, String _name, int _id_category) { try { waitsong pesna = new waitsong { id_waitsong=1, author_waitsong=_author, name_waitsong=_name, id_category=_id_category }; testcontext.waitsongs.AddObject(pesna); testcontext.SaveChanges(); UpdateWaitSongs(); return true; } catch (Exception ex) { MessageBox.Show("Настана проблем при додавање на песната во листата на чекање.\nПроверете ја вашата интернет конекција.", "Грешка при внесување"); MessageBox.Show(ex.InnerException.ToString()); return false; } }