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.ComponentModel; | |
using System.Web.UI.WebControls; | |
public static class Helpers | |
{ | |
public static IEnumerable<ListItem> EnumDropDown<T>() | |
{ | |
foreach (var name in Enum.GetNames(typeof(T))) |
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 string PHPMd5Hash(string pass) | |
{ | |
using (MD5 md5 = MD5.Create()) | |
{ | |
byte[] input = Encoding.UTF8.GetBytes(pass); | |
byte[] hash = md5.ComputeHash(input); | |
return BitConverter.ToString(hash).Replace("-", ""); | |
} | |
} |
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.Configuration; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Web; | |
using BCrypt.Net; | |
public static class Helper | |
{ | |
internal static T GetAppSetting<T>(string key, T Default) |
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
namespace Utils | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
public class Base65Encoding | |
{ | |
private const string Characters = "0123456789AaBbCcDdEeFfGgHhIiJjKklLMmNnOoPpQqRrSsTtUuVvWwXxYyZz._-"; |
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
//Something like this | |
protected string _roles; | |
public virtual List<string> Roles | |
{ | |
get | |
{ | |
if (String.IsNullOrEmpty(_roles)) return new List<string>(); | |
return _roles.Split(new[] {"|"}, StringSplitOptions.None).ToList(); | |
} |
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
namespace NUSSL.NUSExtra.Core.Model.Base | |
{ | |
using System; | |
using System.Diagnostics; | |
public sealed class Check | |
{ | |
#region Constructors | |
private Check() |
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
namespace Utils.Extension | |
{ | |
using System.Drawing; | |
using System.Security.Cryptography; | |
public static class ExtendImage | |
{ | |
public static bool EqualImage(this Image img, Image imgToCompare) | |
{ | |
if (img == null && imgToCompare == null) |
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
namespace NUSSL.NUSExtra.Core.Caching | |
{ | |
using System; | |
using System.Collections; | |
using System.Text.RegularExpressions; | |
using System.Web.Caching; | |
/// <summary> | |
/// Cache manager - control entries to cache | |
/// </summary> |
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
namespace Caching | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Web; | |
public static class CacheHelper | |
{ | |
/// <summary> | |
/// Insert value into the cache using |
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
namespace Core.Configuration | |
{ | |
using System; | |
using System.Configuration; | |
public class MessageConfigurationSection : ConfigurationSection | |
{ | |
[ConfigurationProperty("messages", IsDefaultCollection = false)] | |
[ConfigurationCollection(typeof (MessageCollection), AddItemName = "add", ClearItemsName = "clear", RemoveItemName = "remove")] | |
public MessageCollection Messages |