This file contains 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 void ConvertDecimalToSexagesimal(decimal input, out int deg, out int min, out int sec) | |
{ | |
if (input < 0) | |
{ | |
input = -input; | |
} | |
deg = (int)input; | |
min = (int)Math.Round((input - deg) * 60); | |
sec = (int)Math.Round((((input - deg) - (decimal)min / 60) * 3600), 0); |
This file contains 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 bool SendEmail(string mailTo, string subject, string message) { | |
string mailFrom = ConfigurationManager.AppSettings.Get("MailAddress"); | |
string username = ConfigurationManager.AppSettings.Get("MailUsername"); | |
string password = ConfigurationManager.AppSettings.Get("MailPassword"); | |
int port = Convert.ToInt32(ConfigurationManager.AppSettings.Get("MailOutgoingPort")); | |
string mailServer = ConfigurationManager.AppSettings.Get("MailServer"); | |
try | |
{ | |
MailMessage mailMessage = new MailMessage(mailFrom, mailTo, subject, message); |
This file contains 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 class StopwatchActionFilter : ActionFilterAttribute | |
{ | |
private readonly Dictionary<string, Stopwatch> _stopWatches; | |
public StopwatchActionFilter() | |
{ | |
if (_stopWatches == null) | |
_stopWatches = new Dictionary<string, Stopwatch>(); | |
} |