public bool themPhong(PHONGTRO phong) { try { ketNoi.PHONGTROs.InsertOnSubmit(phong); ketNoi.SubmitChanges(); return(true); } catch (Exception) { return(false); throw; } }
public bool capNhatPhong(PHONGTRO phong) { try { var ketQua = from phongTro in ketNoi.PHONGTROs where phongTro.MAPHONG == phong.MAPHONG select phongTro; foreach (var tam in ketQua) { tam.TRANGTHAI = phong.TRANGTHAI; tam.TIENPHONG = phong.TIENPHONG; tam.SONGUOIO = phong.SONGUOIO; } ketNoi.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
partial void UpdatePHONGTRO(PHONGTRO instance);
partial void DeletePHONGTRO(PHONGTRO instance);
partial void InsertPHONGTRO(PHONGTRO instance);