コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public bool Delete(DTO.CTDoanhthuthang dto)
 {
     return(dal.Delete(dto));
 }
コード例 #5
0
 public bool Update(DTO.CTDoanhthuthang dto)
 {
     return(dal.Update(dto));
 }
コード例 #6
0
 public bool Add(DTO.CTDoanhthuthang dto)
 {
     return(dal.Add(dto));
 }