Skip to content

Instantly share code, notes, and snippets.

View ChrisMoney's full-sized avatar

Chris Weathers ChrisMoney

  • Onevested
  • St. Louis, MO
View GitHub Profile
@ChrisMoney
ChrisMoney / virtual.cs
Created May 23, 2024 13:44
Virtual Method
public virtual void MakeSound()
{
Console.WriteLine("The animal makes a sound");
}
public override void MakeSound()
{
Console.WriteLine("The cat meows");
}
@ChrisMoney
ChrisMoney / Server-JS-Async.txt
Last active May 22, 2024 21:22
Async - Call Javascript, draw out UI, then make post back in JS, get data and return it back to JS to display in UI
--WebForm
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Popup container - can be anything you want */
.popup {
position: relative;
display: inline-block;
@ChrisMoney
ChrisMoney / callProc.cs
Created May 3, 2024 18:29
Stored Proc - call stored proc from DAO
public (string, int) FindInsertProc(int upcId, int store, DateTime endDate)
{
var globalDB = new GlobalDBUtilities();
var parameters = new List<OracleParameter>
{
globalDB.OracleParameterWithValue(":Vupc_id", OracleDbType.Int32, upcId),
globalDB.OracleParameterWithValue(":Vstore", OracleDbType.Int32, store),
globalDB.OracleParameterWithValue(":Beg_date", OracleDbType.Date, DateTime.Now),
globalDB.OracleParameterWithValue(":End_date", OracleDbType.Date, endDate),
globalDB.OracleParameterWithValue(":Data_source", OracleDbType.Varchar2, "SHELFMAN"),
@ChrisMoney
ChrisMoney / cursor.sql
Created May 2, 2024 21:51
Cursor - Created SQL Objects in memory with properties to read from later in query
/* Formatted on 2/1/2024 10:10:51 AM (QP5 v5.381) */
DELETE FROM IMPROD.SM_SYS_MENU_STORES
WHERE 1 = 1;
DECLARE
CURSOR stores IS
SELECT STORE
FROM improd.store a
WHERE store_status = 0
AND pos_close_Date IS NULL
@ChrisMoney
ChrisMoney / esl.cs
Last active May 1, 2024 18:05
ESL Sign Pairing - Pair digital sign with updated price data from API.
/// <summary>
/// Associate (link/bind) an ESL to an item
/// </summary>
/// <param name="store">Store Number</param>
/// <param name="itemID">Item Identifier</param>
/// <param name="eslID">ESL Identifier</param>
/// <returns>Link response</returns>
public HanshowIntegrationResponse Pair(int store, string itemID, string eslID, string useFamilyDescription, string userId)
{
try
@ChrisMoney
ChrisMoney / cacheDBCall.cs
Last active May 2, 2024 21:52
Cache DB Call
if (HttpContext.Current.Cache.Get("ef_results") == null)
{
var results = null; // todo: get results from EF
HttpContext.Current.Cache.Add("ef_results", // cache key
results, // cache value
null, // dependencies
System.Web.Caching.Cache.NoAbsoluteExpiration, // absolute expiration
TimeSpan.FromMinutes(30)); // sliding expiration
}
@ChrisMoney
ChrisMoney / cursor.sql
Created February 17, 2024 15:07
Cursor - Allows you to maintain a sql result in an object to iterate through
/* Formatted on 2/1/2024 10:10:51 AM (QP5 v5.381) */
DELETE FROM IMPROD.SM_SYS_MENU_STORES
WHERE 1 = 1;
DECLARE
CURSOR stores IS
SELECT STORE
FROM improd.store a
WHERE store_status = 0
AND pos_close_Date IS NULL
@ChrisMoney
ChrisMoney / merge.sql
Created June 7, 2023 14:14
SQL Merge
MERGE INTO IMPROD.SM_TRAILER_CONTROL_LOG a
USING (SELECT :trailerId AS i_trailer_id,
:outboundSealNumber AS o_outbound_seal_nbr
FROM DUAL
) b
ON (a.TRAILER_ID = b.I_trailer_id
and a.outbound_seal_nbr = o_outbound_seal_nbr)
WHEN MATCHED
THEN
UPDATE SET a.INBOUND_SEAL_NBR = b.O_outbound_seal_nbr,
@ChrisMoney
ChrisMoney / googleMaps.txt
Created January 19, 2022 17:13
Google Maps API Documentation
http://maps.google.com/maps?q=[address]
if (this.HOPolicyType == HOPolicyType_HOE.TC_HO3 or this.HOPolicyType == HOPolicyType_HOE.TC_HO6) {
if (this.ConstructionType != ConstructionType_HOE.TC_L and this.HODW_Earthquake_HOEExists and this.HODW_Loss_Earthquake_HOEExists) {
bool = true;
}
}
return bool;