Skip to content

Instantly share code, notes, and snippets.

View ritacse's full-sized avatar

Wahida Yasmin ritacse

  • Bangladesh
View GitHub Profile
// send parameter
var url = '../ApprovalReportViewer.aspx?docBaseId=' + aData.Doc_Type + "&docCode=" + aData.Code + "&docVersion=" + aData.Version;
window.open(url, '_blank'); // <- This is what makes it open in a new window.
//Get parameter
var docBaseId = $.url().param('docBaseId');
var docCode = $.url().param('docCode');
var docVersion = $.url().param('docVersion');
TransferDt.Columns.Add("Receive Qty"); // Add column
TransferDt.Columns["Receive Qty"].SetOrdinal(24); // set column position
TransferDt.Columns["buyer_po_number"].ColumnName = "PO Number";
TransSpecDt.AcceptChanges();
grdProductTransfar.Columns["Code"].Visible = false;
grdProductTransfar.Columns["Receive Qty"].DefaultCellStyle.BackColor = Color.LightGoldenrodYellow;
int index = grdProductTransfar.SelectedCells[0].ColumnIndex;
/*Removes all elements from the plan cache, removes a specific plan from
the plan cache by specifying a plan handle or SQL handle,
or removes all cache entries associated with a specified resource pool.*/
EXEC DBCC FREEPROCCACHE
DateTime firstDate = orderDt.AsEnumerable().Select(cols => cols.Field<DateTime>("Ship Date")).OrderBy(p => p.Ticks).FirstOrDefault();
DateTime LastDate = orderDt.AsEnumerable().Select(cols => cols.Field<DateTime>("Ship Date")).OrderByDescending(p => p.Ticks).FirstOrDefault();
DateTime maxDate = firstDate.AddMonths(1);
if (maxDate < LastDate)
{
// Do something.
}
@ritacse
ritacse / cacher_intro.md
Created November 9, 2017 11:14
Here are a few tips to help you start building a code snippet library.

Getting Started with Cacher

Use snippets to quickly recall commands

Snippets are the most useful when you want to re-use a shell command or a specific code pattern. Here are a few we have in our library:

@ritacse
ritacse / 0_reuse_code.js
Last active January 2, 2018 11:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console