public bool Delete(DTO.CTDoanhthuthang dto) { SqlConnection _con = dc.GetConnect(); try { _con.Open(); string sqlQuery = string.Format("DELETE FROM CTDOANHTHUTHANG WHERE THANG='{0}' AND MACHUYENBAY='{1}'", dto.thang, dto.machuyenbay); SqlCommand cmd = new SqlCommand(sqlQuery, _con); if (cmd.ExecuteNonQuery() > 0) { return(true); } } catch (Exception a) { } finally { _con.Close(); } return(false); }
public bool Update(DTO.CTDoanhthuthang dto) { SqlConnection _con = dc.GetConnect(); try { _con.Open(); string sqlQuery = string.Format("UPDATE CTDOANHTHUTHANG SET SOVEBANDUOC='{0}', DOANHTHU='{1}' WHERE THANG='{2}' MACHUYENBAY='{3}')", dto.sovebanduoc, dto.doanhthu, dto.thang, dto.machuyenbay); SqlCommand cmd = new SqlCommand(sqlQuery, _con); if (cmd.ExecuteNonQuery() > 0) { return(true); } } catch (Exception a) { } finally { _con.Close(); } return(false); }
public bool Add(DTO.CTDoanhthuthang dto) { SqlConnection _con = dc.GetConnect(); try { _con.Open(); string sqlQuery = string.Format("INSERT INTO CTDOANHTHUTHANG(THANG, MACHUYENBAY, SOVEBANDUOC, DOANHTHU) VALUES('{0}', '{1}', '{2}', '{3}')", dto.thang, dto.machuyenbay, dto.sovebanduoc, 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.CTDoanhthuthang dto) { return(dal.Delete(dto)); }
public bool Update(DTO.CTDoanhthuthang dto) { return(dal.Update(dto)); }
public bool Add(DTO.CTDoanhthuthang dto) { return(dal.Add(dto)); }