Beispiel #1
0
        public bool DeleteReceipt(string bookID, string receiptID)
        {
            string query = string.Empty;

            object[] para = { receiptID, bookID };

            query += "DELETE FROM  PHIEUMUON WHERE MAPM = @MAPM AND MASACH = @MASACH";

            return(dataprovider.excuteNonQuery(query, para));
        }
        public bool CreateReturnReceipt(PhieuTraDTO returnreceipt)
        {
            string query = string.Empty;

            object[] listpara = { returnreceipt.Mapm, returnreceipt.Masach, returnreceipt.Madg, returnreceipt.Ngaytra, returnreceipt.Tienphat };

            query += "INSERT INTO PHIEUTRA (MAPM, MASACH, MADG, NGAYTRA, TIENPHAT)";
            query += " VALUES ( @MaPM , @MaSach , @MaDG , @NgayTra , @TienPhat )";

            return(dataprovider.excuteNonQuery(query, listpara));
        }
Beispiel #3
0
        public bool Edit(SachDTO sachDTO)
        {
            string query = string.Empty;

            object[] listpara = { sachDTO.Tensach, sachDTO.Tacgia, sachDTO.Theloai, sachDTO.Nxb, sachDTO.Namxb, sachDTO.Ngaynhap, sachDTO.Dongia, sachDTO.Soluong, sachDTO.Luotmuon, sachDTO.Masach };

            query += "UPDATE SACH ";
            query += "SET TENSACH = @Tensach , TACGIA = @Tacgia , MATHELOAI = @Matheloai , NXB = @Nxb , NAMXB = @Namxb , ";
            query += "NGAYNHAP = @Ngaynhap , DONGIA = @Dongia , SACH.SOLUONG = @Soluong , LUOTMUON = @Luotmuon ";
            query += "WHERE MASACH = @Masach ";

            return(dataprovider.excuteNonQuery(query, listpara));
        }