当前位置: 首页>>代码示例>>Golang>>正文


Golang rlib.Errcheck函数代码示例

本文整理汇总了Golang中rentroll/rlib.Errcheck函数的典型用法代码示例。如果您正苦于以下问题:Golang Errcheck函数的具体用法?Golang Errcheck怎么用?Golang Errcheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Errcheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: LedgerReportsByRentable

// LedgerReportsByRentable looks for every rental agreement that overlaps [d1,d2) for the supplied unit.
// It then processes each rental agreement over the specified time range.
func LedgerReportsByRentable(xprop *XBusiness, xu *XUnit, d1, d2 *time.Time) {
	rows, err := App.prepstmt.getUnitRentalAgreements.Query(xu.R.UNITID, d1, d2)
	rlib.Errcheck(err)
	defer rows.Close()
	// billing := make([]*RentalList, 0)
	var billing []*RentalList
	for rows.Next() {
		var ra RentalAgreement
		rlib.Errcheck(rows.Scan(&ra.RAID, &ra.RATID, &ra.BID, &ra.RID, &ra.UNITID, &ra.PID, &ra.PrimaryTenant, &ra.RentalStart, &ra.RentalStop, &ra.Renewal, &ra.SpecialProvisions, &ra.LastModTime, &ra.LastModBy))
		var xp XPerson
		GetPayor(ra.PID, &xp.pay)
		xp.psp.PRSPID = 0 // force load
		xp.tnt.TID = 0    // force load
		xp.trn.TCID = 0   // force load
		GetXPerson(xp.pay.TCID, &xp)
		var b RentalList
		b.ra = &ra
		b.xp = &xp
		billing = append(billing, &b)
	}
	switch xu.R.RTID {
	case RTRESIDENCE:
		UnitReport(xprop, xu, &billing, d1, d2)
	default:
		RentableReport(xprop, xu, &billing, d1, d2)
	}
	rlib.Errcheck(rows.Err())
}
开发者ID:stmansour,项目名称:rentroll,代码行数:30,代码来源:run.go

示例2: GetReceiptAllocations

// GetReceiptAllocations loads all receipt allocations associated with the supplied receipt id into
// the RA array within a Receipt structure
func GetReceiptAllocations(rcptid int, r *Receipt) {
	rows, err := App.prepstmt.getReceiptAllocations.Query(rcptid)
	rlib.Errcheck(err)
	defer rows.Close()
	r.RA = make([]ReceiptAllocation, 0)
	for rows.Next() {
		var a ReceiptAllocation
		rlib.Errcheck(rows.Scan(&a.RCPTID, &a.Amount, &a.ASMID, &a.AcctRule))
		r.RA = append(r.RA, a)
	}
}
开发者ID:stmansour,项目名称:rentroll,代码行数:13,代码来源:get.go

示例3: GetJournalAllocations

// GetJournalAllocations loads all Journal allocations associated with the supplied Journal id into
// the RA array within a Journal structure
func GetJournalAllocations(jid int, j *Journal) {
	rows, err := App.prepstmt.getJournalAllocations.Query(jid)
	rlib.Errcheck(err)
	defer rows.Close()
	j.JA = make([]JournalAllocation, 0)
	for rows.Next() {
		var a JournalAllocation
		rlib.Errcheck(rows.Scan(&a.JID, &a.Amount, &a.ASMID, &a.AcctRule))
		j.JA = append(j.JA, a)
	}
}
开发者ID:stmansour,项目名称:rentroll,代码行数:13,代码来源:get.go

示例4: GetAllRentableAssessments

// GetAllRentableAssessments for the supplied RID and date range
func GetAllRentableAssessments(RID int, d1, d2 *time.Time) []Assessment {
	rows, err := App.prepstmt.getAllRentableAssessments.Query(RID, d1, d2)
	rlib.Errcheck(err)
	defer rows.Close()
	var t []Assessment
	t = make([]Assessment, 0)
	for i := 0; rows.Next(); i++ {
		var a Assessment
		rlib.Errcheck(rows.Scan(&a.ASMID, &a.BID, &a.RID, &a.UNITID, &a.ASMTID, &a.RAID, &a.Amount, &a.Start, &a.Stop, &a.Frequency, &a.ProrationMethod, &a.AcctRule, &a.LastModTime, &a.LastModBy))
		t = append(t, a)
	}
	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:14,代码来源:get.go

示例5: JournalReportText

// JournalReportText generates a textual journal report for the supplied business and time range
func JournalReportText(xprop *XBusiness, d1, d2 *time.Time) {
	printJournalHeader(xprop, d1, d2)
	rows, err := App.prepstmt.getAllJournalsInRange.Query(xprop.P.BID, d1, d2)
	rlib.Errcheck(err)
	defer rows.Close()
	for rows.Next() {
		var j Journal
		rlib.Errcheck(rows.Scan(&j.JID, &j.BID, &j.RAID, &j.Dt, &j.Amount, &j.Type, &j.ID))
		GetJournalAllocations(j.JID, &j)
		textReportJournalEntry(&j, d1, d2)
	}
	rlib.Errcheck(rows.Err())
}
开发者ID:stmansour,项目名称:rentroll,代码行数:14,代码来源:jreport.go

示例6: GetJournalMarkers

// GetJournalMarkers loads the last n journal markers
func GetJournalMarkers(n int) []JournalMarker {
	rows, err := App.prepstmt.getJournalMarkers.Query(n)
	rlib.Errcheck(err)
	defer rows.Close()
	var t []JournalMarker
	t = make([]JournalMarker, 0)
	for rows.Next() {
		var r JournalMarker
		rlib.Errcheck(rows.Scan(&r.JMID, &r.BID, &r.State, &r.DtStart, &r.DtStop))
		t = append(t, r)
	}
	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:14,代码来源:get.go

示例7: GetSecurityDepositAssessments

// GetSecurityDepositAssessments returns all the security deposit assessments for the supplied unit
func GetSecurityDepositAssessments(unitid int) []Assessment {
	var m []Assessment
	rows, err := App.prepstmt.getSecurityDepositAssessment.Query(unitid)
	rlib.Errcheck(err)
	defer rows.Close()

	for rows.Next() {
		var a Assessment
		rlib.Errcheck(rows.Scan(&a.ASMID, &a.BID, &a.RID, &a.UNITID, &a.ASMTID, &a.RAID, &a.Amount, &a.Start, &a.Stop, &a.Frequency, &a.ProrationMethod, &a.AcctRule))
		m = append(m, a)
	}
	rlib.Errcheck(rows.Err())
	return m
}
开发者ID:stmansour,项目名称:rentroll,代码行数:15,代码来源:get.go

示例8: GetBusinessUnitTypes

// GetBusinessUnitTypes returns a slice of payment types indexed by the PMTID
func GetBusinessUnitTypes(bid int) map[int]UnitType {
	var t map[int]UnitType
	t = make(map[int]UnitType, 0)
	rows, err := App.prepstmt.getAllBusinessUnitTypes.Query(bid)
	rlib.Errcheck(err)
	defer rows.Close()
	for rows.Next() {
		var a UnitType
		rlib.Errcheck(rows.Scan(&a.UTID, &a.BID, &a.Style, &a.Name, &a.SqFt, &a.Frequency, &a.Proration, &a.LastModTime, &a.LastModBy))
		t[a.UTID] = a
	}
	rlib.Errcheck(rows.Err())
	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:15,代码来源:get.go

示例9: GetUnitSpecialties

// GetUnitSpecialties returns a list of specialties associated with the supplied unit
func GetUnitSpecialties(bid, unitid int) []int {
	// first, get the specialties for this unit
	var m []int
	rows, err := App.prepstmt.getUnitSpecialties.Query(bid, unitid)
	rlib.Errcheck(err)
	defer rows.Close()
	for rows.Next() {
		var uspid int
		rlib.Errcheck(rows.Scan(&uspid))
		m = append(m, uspid)
	}
	rlib.Errcheck(rows.Err())
	return m
}
开发者ID:stmansour,项目名称:rentroll,代码行数:15,代码来源:get.go

示例10: GetReceipts

// GetReceipts for the supplied business (bid) in date range [d1 - d2)
func GetReceipts(bid int, d1, d2 *time.Time) []Receipt {
	rows, err := App.prepstmt.getReceiptsInDateRange.Query(bid, d1, d2)
	rlib.Errcheck(err)
	defer rows.Close()
	var t []Receipt
	t = make([]Receipt, 0)
	for rows.Next() {
		var r Receipt
		rlib.Errcheck(rows.Scan(&r.RCPTID, &r.BID, &r.RAID, &r.PMTID, &r.Dt, &r.Amount, &r.AcctRule))
		r.RA = make([]ReceiptAllocation, 0)
		GetReceiptAllocations(r.RCPTID, &r)
		t = append(t, r)
	}
	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:16,代码来源:get.go

示例11: GetAssessmentTypes

// GetAssessmentTypes returns a slice of assessment types indexed by the ASMTID
func GetAssessmentTypes() map[int]AssessmentType {
	var t map[int]AssessmentType
	t = make(map[int]AssessmentType, 0)
	rows, err := App.dbrr.Query("SELECT ASMTID,Name,Type,LastModTime,LastModBy FROM assessmenttypes")
	rlib.Errcheck(err)
	defer rows.Close()

	for rows.Next() {
		var a AssessmentType
		rlib.Errcheck(rows.Scan(&a.ASMTID, &a.Name, &a.Type, &a.LastModTime, &a.LastModBy))
		t[a.ASMTID] = a
	}
	rlib.Errcheck(rows.Err())
	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:16,代码来源:get.go

示例12: GetPaymentTypes

// GetPaymentTypes returns a slice of payment types indexed by the PMTID
func GetPaymentTypes() map[int]PaymentType {
	var t map[int]PaymentType
	t = make(map[int]PaymentType, 0)
	rows, err := App.dbrr.Query("SELECT PMTID,Name,Description,LastModTime,LastModBy FROM paymenttypes")
	rlib.Errcheck(err)
	defer rows.Close()

	for rows.Next() {
		var a PaymentType
		rlib.Errcheck(rows.Scan(&a.PMTID, &a.Name, &a.Description, &a.LastModTime, &a.LastModBy))
		t[a.PMTID] = a
	}
	rlib.Errcheck(rows.Err())
	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:16,代码来源:get.go

示例13: LedgerReportsByBusiness

// LedgerReportsByBusiness calculates all charges for the specified business that occur in
// the supplied start / stop time range.
func LedgerReportsByBusiness(xprop *XBusiness, d1, d2 *time.Time) {
	rows, err := App.prepstmt.getAllRentablesByBusiness.Query(xprop.P.BID)
	rlib.Errcheck(err)
	defer rows.Close()
	for rows.Next() {
		var xu XUnit
		rlib.Errcheck(rows.Scan(&xu.R.RID, &xu.R.LID, &xu.R.RTID, &xu.R.BID, &xu.R.UNITID, &xu.R.Name, &xu.R.Assignment, &xu.R.Report, &xu.R.LastModTime, &xu.R.LastModBy))
		if xu.R.UNITID > 0 {
			GetXUnit(xu.R.RID, &xu)
			LedgerReportsByRentable(xprop, &xu, d1, d2)
		} else {
			fmt.Printf("Rentable ID %d: name = %s, not a unit\n", xu.R.RID, xu.R.Name)
		}
	}
	rlib.Errcheck(rows.Err())
}
开发者ID:stmansour,项目名称:rentroll,代码行数:18,代码来源:run.go

示例14: GetTenant

// GetTenant reads a Tenant structure based on the supplied tenant id
func GetTenant(tcid int, t *Tenant) {
	rlib.Errcheck(App.prepstmt.getTransactant.QueryRow(tcid).Scan(&t.TID, &t.TCID, &t.Points,
		&t.CarMake, &t.CarModel, &t.CarColor, &t.CarYear, &t.LicensePlateState, &t.LicensePlateNumber,
		&t.ParkingPermitNumber, &t.AccountRep, &t.DateofBirth, &t.EmergencyContactName, &t.EmergencyContactAddress,
		&t.EmergencyContactTelephone, &t.EmergencyAddressEmail, &t.AlternateAddress, &t.ElibigleForFutureOccupancy,
		&t.Industry, &t.Source, &t.InvoicingCustomerNumber))
}
开发者ID:stmansour,项目名称:rentroll,代码行数:8,代码来源:get.go

示例15: GetBusinessRentableTypes

// GetBusinessRentableTypes returns a slice of payment types indexed by the PMTID
func GetBusinessRentableTypes(bid int) map[int]RentableType {
	var t map[int]RentableType
	t = make(map[int]RentableType, 0)
	rows, err := App.prepstmt.getAllBusinessRentableTypes.Query(bid)
	rlib.Errcheck(err)
	defer rows.Close()
	for rows.Next() {
		var a RentableType
		rlib.Errcheck(rows.Scan(&a.RTID, &a.BID, &a.Name, &a.Frequency, &a.Proration, &a.LastModTime, &a.LastModBy))
		a.MR = make([]RentableMarketRate, 0)
		GetRentableMarketRates(&a)
		t[a.RTID] = a
	}
	rlib.Errcheck(rows.Err())

	return t
}
开发者ID:stmansour,项目名称:rentroll,代码行数:18,代码来源:get.go


注:本文中的rentroll/rlib.Errcheck函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。