This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static MvcHtmlString QueryStringOrRouteValue(this HtmlHelper htmlHelper, string key) | |
| { | |
| string output = string.Empty; | |
| var qs = htmlHelper.ViewContext.RequestContext.HttpContext.Request.QueryString[key]; | |
| if (!string.IsNullOrEmpty(qs)) | |
| { | |
| output = qs; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @using System.Collections.Generic; | |
| @using System.Globalization; | |
| @{ | |
| int month = DateTime.Now.Month; | |
| if (!string.IsNullOrEmpty(Request.QueryString["month"])) | |
| { | |
| month = int.Parse(Request.QueryString["month"]); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DateTime currentDate = DateTime.Now; | |
| DateTime loopDate; | |
| for (loopDate = currentDate.AddMonths(-11); (loopDate - currentDate).Days < 365; loopDate = loopDate.AddMonths(1)) | |
| { | |
| if(loopDate == currentDate) | |
| { | |
| Console.Write("<<"); | |
| } | |
| Console.Write(loopDate.ToString("MMMM yyyy")); | |
| if(loopDate == currentDate) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| public static class LinqExtensionMethods | |
| { | |
| public static Expression<Func<T, bool>> CombineOr<T>(params Expression<Func<T, bool>>[] filters) | |
| { | |
| return filters.CombineOr(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(".week").datepicker("option", { | |
| beforeShowDay: function (date) | |
| { | |
| return [date.getDay() == 1, '']; | |
| } | |
| }); | |
| // prevent changing weeks and months | |
| var weekOptions = { "changeMonth": false, "changeYear": false, "stepMonths": 0, beforeShowDay: function (date) { | |
| return [date.getDay() == 1, '']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(".month").datepicker("option", { "changeMonth": false, "changeYear": false, "stepMonths": 0}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msiexec /a "c:\path\to\setupfile.msi" /qb TARGETDIR="c:\temp folder" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Reflection; | |
| using System.Collections.Specialized; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using System.IO; | |
| [assembly: AssemblyTitle("CleanWordHtml")] | |
| [assembly: AssemblyDescription("Cleans up HTML generated by Microsoft Word")] | |
| [assembly: AssemblyVersion("1.0.1.*")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <smtp from="me@example.com"> | |
| <network host="mailserver" password="" userName=""/> | |
| </smtp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public object RowData(object row, string column) | |
| { | |
| object output = string.Empty; | |
| if (row is DataRow) | |
| { | |
| DataRow v = row as DataRow; | |
| if (v.Table.Columns.Contains(column)) | |
| { | |
| output = v[column]; | |
| } |