public void themTuYT(string tendn, string tu) { if (ktTuYT(tu, tendn) == false) { TUYEUTHICH tuyt = new TUYEUTHICH(); tuyt.TAIKHOAN = tendn; tuyt.TUVUNG = tu; string result = qltd.TUs.SingleOrDefault(t => t.TUVUNG == tu).MALOAI; tuyt.MALOAI = result; qltd.TUYEUTHICHes.InsertOnSubmit(tuyt); qltd.SubmitChanges(); MessageBox.Show("Đã yêu thích"); } else { TUYEUTHICH tuyt = qltd.TUYEUTHICHes.Where(t => t.TUVUNG == tu).FirstOrDefault(); qltd.TUYEUTHICHes.DeleteOnSubmit(tuyt); qltd.SubmitChanges(); MessageBox.Show("Hết thích rồi"); } }
private void detach_TUYEUTHICHes(TUYEUTHICH entity) { this.SendPropertyChanging(); entity.TU = null; }
private void attach_TUYEUTHICHes(TUYEUTHICH entity) { this.SendPropertyChanging(); entity.TU = this; }
partial void DeleteTUYEUTHICH(TUYEUTHICH instance);
partial void UpdateTUYEUTHICH(TUYEUTHICH instance);
partial void InsertTUYEUTHICH(TUYEUTHICH instance);