public static CBE.CustomerAccountCBE GetCustomerByResidentId(CBE.CustomerAccountCBE customer) { try { CBE.CustomerAccountCollection customers = new CBE.CustomerAccountCollection(); string spName = Constants.oraclePackagePrefix + "ACCOUNT_GETBY_RESIDENTID"; DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName); command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_TMS_ID", DbType.Int32, customer.TmsId, ParameterDirection.Input)); command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_RESIDENT_ID", DbType.String, customer.ResidentId, ParameterDirection.Input)); DataTable dt = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName).Tables[tableName]; customers = ConvertDataTableToCollection(dt); return(customers[0]); } catch (Exception ex) { throw ex; } }
public static VaaaN.MLFF.Libraries.CommonLibrary.CBE.CustomerAccountCollection GetAllAsCollection() { VaaaN.MLFF.Libraries.CommonLibrary.CBE.CustomerAccountCollection accounts = new CBE.CustomerAccountCollection(); try { //Stored procedure must have cur_out parameter. //There is no need to add ref cursor for oracle in code. string spName = VaaaN.MLFF.Libraries.CommonLibrary.Constants.oraclePackagePrefix + "ACCOUNT_GETALL"; DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName); DataSet ds = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName); DataTable dt = ds.Tables[tableName]; accounts = ConvertDataTableToCollection(dt); } catch (Exception ex) { throw ex; } return(accounts); }
public static VaaaN.MLFF.Libraries.CommonLibrary.CBE.CustomerAccountCollection GetLatestCustomerAccounts(DateTime lastCollectionUpdateTime) { VaaaN.MLFF.Libraries.CommonLibrary.CBE.CustomerAccountCollection accounts = new CBE.CustomerAccountCollection(); try { //Stored procedure must have cur_out parameter. //There is no need to add ref cursor for oracle in code. string spName = VaaaN.MLFF.Libraries.CommonLibrary.Constants.oraclePackagePrefix + "ACCOUNT_LATEST_GETALL"; DbCommand command = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.GetStoredProcCommand(spName); command.Parameters.Add(VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.CreateDbParameter(ref command, "P_LAST_UPDATE_TIME", DbType.DateTime, lastCollectionUpdateTime, ParameterDirection.Input)); DataSet ds = VaaaN.MLFF.Libraries.CommonLibrary.DBA.DBAccessor.LoadDataSet(command, tableName); DataTable dt = ds.Tables[tableName]; accounts = ConvertDataTableToCollection(dt); } catch (Exception ex) { throw ex; } return(accounts); }