Example #1
0
        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();
        }
Example #2
0
        public void themCaSiinBaiHat(string mabh, string macs)
        {
            BaiHat bh = da.BaiHats.Where(t => t.maBaiHat == mabh).SingleOrDefault();

            bh.maCaSi = macs;

            da.SubmitChanges();
        }
Example #3
0
        public string getPathBaiHat(string tenBH)
        {
            BaiHat bh = da.BaiHats.Where(t => t.tenBaiHat == tenBH).FirstOrDefault();

            return(bh.pathBaiHat);
        }
Example #4
0
 private void detach_BaiHats(BaiHat entity)
 {
     this.SendPropertyChanging();
     entity.CaSi = null;
 }
Example #5
0
 private void attach_BaiHats(BaiHat entity)
 {
     this.SendPropertyChanging();
     entity.CaSi = this;
 }
Example #6
0
 partial void DeleteBaiHat(BaiHat instance);
Example #7
0
 partial void UpdateBaiHat(BaiHat instance);
Example #8
0
 partial void InsertBaiHat(BaiHat instance);