Skip to content

Instantly share code, notes, and snippets.

@racsonp
racsonp / Navigation Bar.css
Created February 11, 2012 06:28
Basic Navigation Bar
header {
background-color: #093856;
float: left;
width: 100%;
height: 100%;
font-family: 'Verdana';
text-align: center;
font-size: 6em;
color: #ffffff;
}
@racsonp
racsonp / Basic.sql
Last active September 3, 2018 05:53
Basic SQL
--Kill tables
--EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"
-----------------------------------------------------------
-----------------------------------------------------------
--- BASIC DATA BASE
create database Producction
go
use [Producction]
create table Categorias
(
@racsonp
racsonp / .gitignore
Created February 17, 2012 19:58
My Git Ignore
# Visual Studio
obj
bin
src/CommonAssemblyInfo.cs
*.csproj.user
*.suo
*.cache
# Fubu
/src/*/*/*/fubu-content/*/
@racsonp
racsonp / Install_VS2010_SP1.bat
Created March 8, 2012 08:06
VS2010andSP1_InstallAutomatically
::check to determine if the batch script is processed in an elevated process.
@reg add HKLM\Software\Microsoft\DevDiv\0b3d680166a14e50a8c8e2ed060d8d90 /v Elevated /t REG_DWORD /d 1 /f > nul 2>&1
@if /i "%errorlevel%"=="1" echo Error: elevation required. &exit /b 740
@reg delete HKLM\Software\Microsoft\DevDiv\0b3d680166a14e50a8c8e2ed060d8d90 /va /f > nul 2>&1
:: Install VS2010
"%~dp0setup\setup.exe" /q /norestart /unattendfile "%~dp0VS2010_deployment.ini"
:: For full install, comment the line above and uncomment the next line ( Remember you need to create your own "unattend.ini" file
::"%~dp0setup\setup.exe" /q /norestart "
@if /i "%errorlevel%"=="3010" (echo Returned 3010: Need to reboot when setup is complete.) else (
@racsonp
racsonp / gist:3370769
Created August 16, 2012 14:52
Inspection ReShaper Equivalences
//-----------------------------------------------------------------------------------------//
foreach (GridViewRow gvRow in GridView1.Rows)
{
var chkSelected = (CheckBox)gvRow.FindControl("CheckBoxWinner");
chkSelected.Checked = false;
}
//~
foreach (var chkSelected in from GridViewRow gvRow in GridView1.Rows
@racsonp
racsonp / gist:3370869
Created August 16, 2012 15:06
ASP.NET WebUI Date Formart
//To Show time like 08:00: AM
txtStartTime.Text = entity.CommitteeResolutionDate.ToString("hh:mm tt");
@racsonp
racsonp / gist:3370895
Created August 16, 2012 15:11
ASP.NET Check All CheckBoxes in Grid WebForm
//Check All CheckBoxes in Grid WebForm
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
protected void CheckBoxAll_CheckedChanged(object sender, EventArgs e)
{
var chkAll = (CheckBox)GridMemberList.HeaderRow.FindControl("CheckBoxAll");
@racsonp
racsonp / gist:3389627
Created August 18, 2012 20:26
Recursive C#
//http://stackoverflow.com/questions/1504110/recursive-call-return-a-list-return-type-causing-me-issues
// http://stackoverflow.com/questions/7187456/recursive-method-using-list
// http://stackoverflow.com/questions/2572721/recursive-treeview-in-asp-net
@racsonp
racsonp / gist:3438777
Created August 23, 2012 17:06
Get Checked in a grid with Linq
var itemQuantities = new List<RequisitionItemQuantity>();
CreateItemQuantyListForQuery();
foreach (GridViewRow gvRow in GridViewResult.Rows)
{
var chkSelected = (CheckBox)gvRow.FindControl("chkSelect");
if (!chkSelected.Checked)
{
continue;
}
var pkId = (HiddenField)gvRow.FindControl("HidenRequisitionItemQuantity1Pk");
@racsonp
racsonp / gist:3860911
Created October 9, 2012 19:31
Foreach to LINQ Trans
private void SetRequisitionQuantityListToZeroRemain(List<RequisitionItemQuantity> requisitionItemQuantyList,IEnumerable<RequisitionReferencesTemp> requistionAllIdList)
{
//foreach (var requisition in requistionAllIdList)
//{
// var item = requisitionItemQuantyList.FirstOrDefault(x => x.RequisitionItemQuantity1 ==
// requisition.RequisitionItemIdReference);
// if (item == null) continue;
// item.QuantityRemain = 0;
// SetSubTotalRemain(item);