public int UpDatePhieuTra(PhieuThuTienPhatDTO pttp) { int nRow = 0; try { string strSql = "UPDATE PHIEUTRASACH SET TienNo = @TienNo WHERE PHIEUTRASACH.MaPT=@MaPT"; pro.Connect(); nRow = pro.ExecuteNonQuery(CommandType.Text, strSql, new SqlParameter { ParameterName = "@MaPT", Value = pttp.MaPT }, new SqlParameter { ParameterName = "@TienNo", Value = pttp.TienNo }); } catch (SqlException ex) { throw ex; } finally { pro.DisConnect(); } return(nRow); }
public int ThemPhieuThuTienPhat(PhieuThuTienPhatDTO pttp) { try { PhieuThuTienPhatDAO dao = new PhieuThuTienPhatDAO(); return(dao.ThemPhieuThuTienPhat(pttp)); } catch (SqlException ex) { throw ex; } }
public int UpDatePhieuTra(PhieuThuTienPhatDTO pttp) { try { PhieuThuTienPhatDAO dao = new PhieuThuTienPhatDAO(); int nRow = dao.UpDatePhieuTra(pttp); return(nRow); } catch (SqlException ex) { throw ex; } }
public int ThemPhieuThuTienPhat(PhieuThuTienPhatDTO pttp) { int nRow = 0; try { pro.Connect(); string strSql = "INSERT INTO PhieuThuTienPhat VALUES(@MaPhieuThu,@MaNV,@TienThu,@NgayThu,@MaPT,@TienConLai)"; nRow = pro.ExecuteNonQuery(CommandType.Text, strSql, new SqlParameter { ParameterName = "@MaPhieuThu", Value = pttp.MaPhieuThu }, new SqlParameter { ParameterName = "@MaNV", Value = pttp.MaNV }, new SqlParameter { ParameterName = "@TienThu", Value = pttp.TienThu }, new SqlParameter { ParameterName = "@NgayThu", Value = pttp.NgayThu }, new SqlParameter { ParameterName = "@MaPT", Value = pttp.MaPT }, new SqlParameter { ParameterName = "@TienConLai", Value = pttp.TienConLai } ); return(nRow); } catch (SqlException ex) { throw ex; } finally { pro.DisConnect(); } }