/// <summary> /// Method to get prepay global /// </summary> /// <param name="pumpId">Pump id</param> /// <returns>Prepay</returns> public recPump GetPrepayGlobal(int pumpId) { var rec = new recPump(); var dRecset = GetRecords("SELECT * FROM PrepayGlobal WHERE pumpID = " + Convert.ToString(pumpId), DataSource.CSCTrans); if (dRecset.Rows.Count == 0) { rec.IsPrepay = false; rec.IsPrepayLocked = false; if (!(rec.IsHoldPrepay && rec.PrepayAmount > 0)) { rec.PrepayAmount = 0; rec.PrepayInvoiceID = 0; rec.PrepayPosition = 0; } } else { rec.PrepayAmount = CommonUtility.GetFloatValue(dRecset.Rows[0]["Amount"]); rec.IsPrepayLocked = CommonUtility.GetBooleanValue(dRecset.Rows[0]["Locked"]); rec.PrepayInvoiceID = CommonUtility.GetIntergerValue(dRecset.Rows[0]["InvoiceID"]); rec.PrepayPosition = CommonUtility.GetShortValue(dRecset.Rows[0]["PositionID"]); rec.IsPrepay = true; } return(rec); }
/// <summary> /// Method to load prepay /// </summary> /// <param name="pumpId">Pump Id</param> /// <returns>Prepay</returns> public recPump LoadPrepay(int pumpId) { recPump rec; var dRecset = GetRecords("SELECT * FROM PrepayGlobal WHERE pumpID = " + Convert.ToString(pumpId), DataSource.CSCTrans); if (dRecset.Rows.Count == 0) { rec = new recPump { IsHoldPrepay = false, IsPrepay = false, PrepayAmount = 0, IsPrepayLocked = false, PrepayInvoiceID = 0, PrepayPosition = 0 }; } else { rec = new recPump { IsHoldPrepay = true, IsPrepay = true, PrepayAmount = CommonUtility.GetFloatValue(dRecset.Rows[0]["Amount"]), IsPrepayLocked = CommonUtility.GetBooleanValue(dRecset.Rows[0]["Locked"]), PrepayInvoiceID = CommonUtility.GetIntergerValue(dRecset.Rows[0]["InvoiceID"]), PrepayPosition = CommonUtility.GetShortValue(dRecset.Rows[0]["PositionID"]) }; } return(rec); }