public bool XoaCauThu(string ma) { tblCauThu temp = db.tblCauThus.Where(x => x.MaCauThu == ma).FirstOrDefault(); try { db.tblCauThus.DeleteOnSubmit(temp); } catch (Exception e) { throw new Exception("Lỗi không xóa được " + e.Message); } return(true); }
public bool suaThongTinCauThu(eCauThu ct) { tblCauThu nct = db.tblCauThus.Where(x => x.MaCauThu == ct.MaCauThu).FirstOrDefault(); nct.TenCauThu = ct.TenCauThu; nct.SoDienThoai = ct.SoDienThoai; nct.Email = ct.Email; nct.IdDoiBong = ct.MaDoiBong; try { db.SubmitChanges(); } catch (Exception e) { throw new Exception("Lỗi không sửa được " + e.Message); } return(true); }
public int themThanhVien(eCauThu ct) { tblCauThu temp = db.tblCauThus.Where(x => x.MaCauThu == ct.MaCauThu).FirstOrDefault(); if (temp != null) { return(0); } tblCauThu newct = new tblCauThu(); newct.MaCauThu = ct.MaCauThu; newct.TenCauThu = ct.TenCauThu; newct.SoDienThoai = ct.SoDienThoai; newct.Email = ct.Email; newct.IdDoiBong = ct.MaDoiBong; db.tblCauThus.InsertOnSubmit(newct); db.SubmitChanges(); return(1); }
private void detach_tblCauThus(tblCauThu entity) { this.SendPropertyChanging(); entity.tblDoiBong = null; }
partial void DeletetblCauThu(tblCauThu instance);
partial void UpdatetblCauThu(tblCauThu instance);
partial void InserttblCauThu(tblCauThu instance);