Exemplo n.º 1
0
        void AddArtist()
        {
            HtmlDocument wap      = new HtmlDocument();
            string       htmlCode = File.ReadAllText("E:\\Artist.txt");

            wap.LoadHtml(htmlCode);

            HtmlNodeCollection Artists = wap.DocumentNode.SelectNodes("//div[@class='singer-block-item']");

            foreach (HtmlNode node in Artists)
            {
                try
                {
                    MG_Artist myArtist = new MG_Artist();
                    myArtist.Nation     = ((ComboBoxItem)ComboBox.SelectedValue).Content.ToString();
                    myArtist.NameArtist = node.ChildNodes[3].InnerText;
                    db.MG_Artists.InsertOnSubmit(myArtist);
                    db.SubmitChanges();
                }
                catch { MessageBox.Show("Remove!"); }
            }
        }
Exemplo n.º 2
0
 partial void DeleteMG_Artist(MG_Artist instance);
Exemplo n.º 3
0
 partial void UpdateMG_Artist(MG_Artist instance);
Exemplo n.º 4
0
 partial void InsertMG_Artist(MG_Artist instance);