public bool Delete(DTO_DoanhThuNam dto) { try { _con.Open(); string sqlQuery = string.Format("DELETE FROM DOANHTHUNAM WHERE NAM='{0}'", dto.Nam); SqlCommand cmd = new SqlCommand(sqlQuery, _con); if (cmd.ExecuteNonQuery() > 0) { return(true); } } catch (Exception a) { } finally { _con.Close(); } return(false); }
public bool Update(DTO_DoanhThuNam dto) { try { _con.Open(); string sqlQuery = string.Format("UPDATE DOANHTHUNAM SET DOANHTHU='{0}' WHERE NAM='{1}')", dto.DoanhThu, dto.Nam); SqlCommand cmd = new SqlCommand(sqlQuery, _con); if (cmd.ExecuteNonQuery() > 0) { return(true); } } catch (Exception a) { } finally { _con.Close(); } return(false); }
public bool Add(DTO_DoanhThuNam dto) { try { _con.Open(); string sqlQuery = string.Format("INSERT INTO DOANHTHUNAM(NAM, DOANHTHU) VALUES('{0}', '{1}')", dto.Nam, dto.DoanhThu); SqlCommand cmd = new SqlCommand(sqlQuery, _con); if (cmd.ExecuteNonQuery() > 0) { return(true); } } catch (Exception a) { } finally { _con.Close(); } return(false); }
public bool Delete(DTO_DoanhThuNam dto) { return(dal.Delete(dto)); }
public bool Update(DTO_DoanhThuNam dto) { return(dal.Update(dto)); }
public bool Add(DTO_DoanhThuNam dto) { return(dal.Add(dto)); }