Exemplo n.º 1
0
        public bool Add(ClassDetailBill.DetailBill detailBill)
        {
            string query = "INSERT INTO CTHoaDon VALUES ( @MaHD , @MaSP , @SoLuong  )";

            object[] para = new object[] { detailBill.MaHD, detailBill.MaSP, detailBill.SoLuong };

            if (DataProvider.Instance.ExecuteNonQuery(query, para) > 0)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public bool Edit(ClassDetailBill.DetailBill detailBill)
        {
            string MaHD  = detailBill.MaHD;
            string MaSP  = detailBill.MaSP;
            string query = "UPDATE CTHoaDon SET SoLuong = @SoLuong WHERE MaHD = @MaHD AND MaSP = @MaSP ";

            object[] para = new object[] { detailBill.SoLuong, detailBill.MaHD, detailBill.MaSP };

            if (DataProvider.Instance.ExecuteNonQuery(query, para) > 0)
            {
                return(true);
            }
            return(false);
        }