Beispiel #1
0
        public bool Delete(DTO.Doanhthuthang dto)
        {
            SqlConnection _con = dc.GetConnect();

            try
            {
                _con.Open();
                string     sqlQuery = string.Format("DELETE FROM DOANHTHUTHANG WHERE THANG='{0}' AND NAM='{1}'", dto.thang, dto.nam);
                SqlCommand cmd      = new SqlCommand(sqlQuery, _con);
                if (cmd.ExecuteNonQuery() > 0)
                {
                    return(true);
                }
            }
            catch (Exception a)
            {
            }
            finally
            {
                _con.Close();
            }
            return(false);
        }
Beispiel #2
0
        public bool Update(DTO.Doanhthuthang dto)
        {
            SqlConnection _con = dc.GetConnect();

            try
            {
                _con.Open();
                string     sqlQuery = string.Format("UPDATE DOANHTHUTHANG SET SOCHUYENBAY='{0}', DOANHTHU='{1}' WHERE THANG='{2}' AND NAM='{3}')", dto.sochuyenbay, dto.doanhthu, dto.thang, dto.nam);
                SqlCommand cmd      = new SqlCommand(sqlQuery, _con);
                if (cmd.ExecuteNonQuery() > 0)
                {
                    return(true);
                }
            }
            catch (Exception a)
            {
            }
            finally
            {
                _con.Close();
            }
            return(false);
        }
Beispiel #3
0
        public bool Add(DTO.Doanhthuthang dto)
        {
            SqlConnection _con = dc.GetConnect();

            try
            {
                _con.Open();
                string     sqlQuery = string.Format("INSERT INTO DOANHTHUTHANG(THANG, NAM, SOCHUYENBAY, DOANHTHU) VALUES('{0}', '{1}', '{2}', '{3}')", dto.thang, dto.nam, dto.sochuyenbay, dto.doanhthu);
                SqlCommand cmd      = new SqlCommand(sqlQuery, _con);
                if (cmd.ExecuteNonQuery() > 0)
                {
                    return(true);
                }
            }
            catch (Exception a)
            {
            }
            finally
            {
                _con.Close();
            }
            return(false);
        }
Beispiel #4
0
 public bool Delete(DTO.Doanhthuthang dto)
 {
     return(dal.Delete(dto));
 }
Beispiel #5
0
 public bool Update(DTO.Doanhthuthang dto)
 {
     return(dal.Update(dto));
 }
Beispiel #6
0
 public bool Add(DTO.Doanhthuthang dto)
 {
     return(dal.Add(dto));
 }