public void setBaiHat(string tenBH, string pathName) { List <BaiHat> bh2 = da.BaiHats.Select(k => k).ToList(); int[] chuoisoint = new int[bh2.Count()]; for (int i = 0; i < bh2.Count(); i++) { string m = bh2[i].maBaiHat; chuoisoint[i] = int.Parse(m.Substring(2)); } int max = chuoisoint[0]; for (int j = 1; j < bh2.Count(); j++) { if (chuoisoint[j] > max) { max = chuoisoint[j]; } } BaiHat bh = new BaiHat(); bh.maBaiHat = "BH" + max; bh.tenBaiHat = tenBH; bh.maCaSi = null; bh.pathBaiHat = pathName; da.BaiHats.InsertOnSubmit(bh); da.SubmitChanges(); }
public void themCaSiinBaiHat(string mabh, string macs) { BaiHat bh = da.BaiHats.Where(t => t.maBaiHat == mabh).SingleOrDefault(); bh.maCaSi = macs; da.SubmitChanges(); }
public string getPathBaiHat(string tenBH) { BaiHat bh = da.BaiHats.Where(t => t.tenBaiHat == tenBH).FirstOrDefault(); return(bh.pathBaiHat); }
private void detach_BaiHats(BaiHat entity) { this.SendPropertyChanging(); entity.CaSi = null; }
private void attach_BaiHats(BaiHat entity) { this.SendPropertyChanging(); entity.CaSi = this; }
partial void DeleteBaiHat(BaiHat instance);
partial void UpdateBaiHat(BaiHat instance);
partial void InsertBaiHat(BaiHat instance);