/// <summary> /// Gets the last printed ID. /// </summary> /// <param name="storeID">The store ID.</param> /// <param name="paymentTypeID">The payment type ID.</param> /// <returns></returns> public static int GetLastPrintedIDByPaymentTypeID(int activityId, int?paymentTypeId) { Issue s = new Issue(); string query = ""; query = HCMIS.Repository.Queries.Issue.SelectGetLastPrintedIDByPaymentTypeID(activityId, paymentTypeId); s.LoadFromRawSql(query); int calculatedId; try { calculatedId = int.Parse(s.GetColumn("IDPrinted").ToString()); } catch { calculatedId = 0; } int startingPointID = 0;// A provision in case the STV or invoice number is required to start from a certain number. if (calculatedId <= startingPointID && calculatedId != 0) { return(startingPointID); } else { return(calculatedId); } }
public static int GetConfirmedInvoices() { var query = HCMIS.Repository.Queries.Issue.SelectGetConfirmedInvoices(); var iss = new Issue(); iss.LoadFromRawSql(query); return Convert.ToInt32(iss.GetColumn("Value")); }
public static int GetConfirmedInvoices() { var query = HCMIS.Repository.Queries.Issue.SelectGetConfirmedInvoices(); var iss = new Issue(); iss.LoadFromRawSql(query); return(Convert.ToInt32(iss.GetColumn("Value"))); }
/// <summary> /// Gets the last printed ID. /// </summary> /// <param name="storeID">The store ID.</param> /// <param name="paymentTypeID">The payment type ID.</param> /// <returns></returns> public static int GetLastPrintedIDByPaymentTypeID(int activityId, int? paymentTypeId) { Issue s = new Issue(); string query = ""; query = HCMIS.Repository.Queries.Issue.SelectGetLastPrintedIDByPaymentTypeID(activityId, paymentTypeId); s.LoadFromRawSql(query); int calculatedId; try { calculatedId = int.Parse(s.GetColumn("IDPrinted").ToString()); } catch { calculatedId = 0; } int startingPointID = 0;// A provision in case the STV or invoice number is required to start from a certain number. if (calculatedId <= startingPointID && calculatedId != 0) return startingPointID; else return calculatedId; }