public static List <ClaimPayment> GetClaimPaymentNotificationListByBatchId(Guid batchId) { List <ClaimPayment> list = new List <ClaimPayment>(); Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetClaimPaymentNotificationListByBatchId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@BatchId", DbType.Guid, batchId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { ClaimPayment claimPayment = new ClaimPayment(); //claimPayment.ClaimPaymentId = Convert.ToInt32(dataReader["ClaimPaymentId"]); claimPayment.PaidEmail = dataReader["PaidEmail"].ToString(); claimPayment.EmailSubject = dataReader["EmailSubject"].ToString(); claimPayment.EmailBody = dataReader["EmailBody"].ToString(); list.Add(claimPayment); } } return(list); }
public static List <ClaimPayment> GetClaimPaymentListByClaimMonthAndStoreId(string claimMonth, int storeId, int accountId) { List <ClaimPayment> list = new List <ClaimPayment>(); Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetClaimPaymentListByClaimMonthAndStoreId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@ClaimMonth", DbType.String, claimMonth); db.AddInParameter(dbCommand, "@StoreId", DbType.Int32, storeId); db.AddInParameter(dbCommand, "@AccountId", DbType.Int32, accountId); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { ClaimPayment claimPayment = new ClaimPayment(); //claimPayment.ClaimScheduleId = Convert.ToInt32(dataReader["ClaimScheduleId"]); claimPayment.ClaimId = Convert.ToInt32(dataReader["ClaimId"]); claimPayment.ClaimPaymentId = Convert.ToInt32(dataReader["ClaimPaymentId"]); claimPayment.Payment = Convert.ToInt32(dataReader["Payment"]); claimPayment.PaymentDate = Convert.ToDateTime(dataReader["PaymentDate"]); claimPayment.ClaimNumber = dataReader["ClaimNumber"].ToString(); claimPayment.ClaimValueCurrent = Convert.ToDecimal(dataReader["Value"]); claimPayment.ClaimDate = Convert.ToDateTime(dataReader["ClaimDate"]); claimPayment.Store = dataReader["Store"].ToString(); claimPayment.ClaimSkuCategory = dataReader["ClaimSkuCategory"].ToString(); claimPayment.ClaimSkuSubCategory = dataReader["ClaimSkuSubCategory"].ToString(); claimPayment.ClaimSupplier = dataReader["ClaimSupplier"].ToString(); claimPayment.ClaimType = dataReader["ClaimType"].ToString(); list.Add(claimPayment); } } return(list); }
public static List <ClaimPayment> GetClaimPaymentFNBListByClaimMonthAndLocationId(string claimMonth, int locationId /*, int isDairy, int companyId*//*, string claimNumber*/) { List <ClaimPayment> list = new List <ClaimPayment>(); Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetClaimPaymentFNBListByClaimMonthAndLocationId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@ClaimMonth", DbType.String, claimMonth); db.AddInParameter(dbCommand, "@LocationId", DbType.Int32, locationId); //db.AddInParameter(dbCommand, "@IsDairy", DbType.Int32, isDairy); //db.AddInParameter(dbCommand, "@CompanyId", DbType.Int32, companyId); //db.AddInParameter(dbCommand, "@ClaimNumber", DbType.String, claimNumber); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { ClaimPayment claimPayment = new ClaimPayment(); claimPayment.Store = dataReader["Store"].ToString(); claimPayment.AccountNumber = dataReader["AccountNumber"].ToString(); claimPayment.AccountType = dataReader["AccountType"].ToString(); claimPayment.BranchNumber = dataReader["BranchNumber"].ToString(); claimPayment.TotalStoreValuePaid = Convert.ToDecimal(dataReader["TotalValue"]); claimPayment.OwnReference = dataReader["OwnReference"].ToString(); claimPayment.RecipientReference = dataReader["RecipientReference"].ToString(); list.Add(claimPayment); } } return(list); }
public static ClaimPayment GetClaimPaymentByClaimPaymentId(int claimPaymentId) { Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetClaimPaymentByClaimPaymentId"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@ClaimPaymentId", DbType.Int32, claimPaymentId); db.AddOutParameter(dbCommand, "@Explanation", DbType.String, 500); db.AddOutParameter(dbCommand, "@ClaimNumber", DbType.String, 50); db.ExecuteNonQuery(dbCommand); ClaimPayment claimPayment = new ClaimPayment(); claimPayment.ClaimPaymentId = claimPaymentId; claimPayment.Explanation = db.GetParameterValue(dbCommand, "Explanation").ToString(); claimPayment.ClaimNumber = db.GetParameterValue(dbCommand, "ClaimNumber").ToString(); return(claimPayment); }
public static ClaimPayment GetClaimPaymentValidationNotification(int claimId) { Database db = DatabaseFactory.CreateDatabase("Spar-StoreRep"); string sqlCommand = "GetClaimPaymentValidationNotification"; DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand); db.AddInParameter(dbCommand, "@ClaimId", DbType.Int32, claimId); db.AddOutParameter(dbCommand, "@EmailSubject", DbType.String, 1000); db.AddOutParameter(dbCommand, "@EmailBody", DbType.String, 4000); db.ExecuteNonQuery(dbCommand); ClaimPayment claimPayment = new ClaimPayment(); claimPayment.ClaimId = claimId; claimPayment.EmailSubject = db.GetParameterValue(dbCommand, "EmailSubject").ToString(); claimPayment.EmailBody = db.GetParameterValue(dbCommand, "EmailBody").ToString(); return(claimPayment); }