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
private static readonly StringBuilder Sb = new StringBuilder(); | |
private static void ShowResults() | |
{ | |
const string outputFile = "output.txt"; | |
File.WriteAllText(outputFile, Sb.ToString()); | |
Process.Start("notepad", outputFile); | |
} |
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
<system.webServer> | |
<modules> | |
<add | |
name="SuppressFormsAuthenticationRedirectModule" | |
type="SuppressFormsAuthenticationRedirectModule"/> | |
</modules> | |
</system.webServer> |
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 SuppressFormsAuthenticationRedirectModule : IHttpModule | |
{ | |
public void Init(HttpApplication context) | |
{ | |
context.PostReleaseRequestState += OnPostReleaseRequestState; | |
} | |
private void OnPostReleaseRequestState(object source, EventArgs args) | |
{ | |
var context = (HttpApplication)source; |
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Text; | |
namespace Accounting.Domain.Entities | |
{ |
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
-- -------------------------------------------------- | |
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure | |
-- -------------------------------------------------- | |
-- Date Created: 07/26/2012 11:32:16 | |
-- Generated from EDMX file: C:\GitHub\da-projects\1\EomTool\EomApp1\Screens\Security\Models\EomToolSecurity.edmx | |
-- -------------------------------------------------- | |
SET QUOTED_IDENTIFIER OFF; | |
GO | |
USE [EomToolSecurity]; |
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
namespace WindowsGame1.PhysicalModel | |
{ | |
public class Body : PhysicalObject | |
{ | |
public Body() : this("body") { } | |
public Body(string name) | |
: base(name) | |
{ | |
Torso = new torso(); |
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
using System.Linq; | |
using System.Web.Http; | |
using DirectAgents.Domain.Concrete; | |
using EomToolWeb.Models; | |
namespace EomToolWeb.Controllers | |
{ | |
public class CampaignsApiController : ApiController | |
{ | |
private EFDbContext db = new EFDbContext(); |
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
using System; | |
using System.Net.Mail; | |
public static class EmailUtility | |
{ | |
public static void SendEmail(string from, string[] to, string[] cc, string subject, string body, bool isHTML) | |
{ | |
MailMessage message = new MailMessage | |
{ | |
Subject = subject, |
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
using System.Data.SqlClient; | |
using System.Text.RegularExpressions; | |
using System.Collections; | |
public static class SqlUtility | |
{ | |
public static T ExecuteScalar<T>(string connStr, string query, params object[] queryParams) | |
{ | |
using (var con = new SqlConnection(connStr)) | |
using (var cmd = new SqlCommand(query, con)) |
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
static void CopyProperties(object sourceObject, object targetObject, bool deepCopy = true) | |
{ | |
if (sourceObject != null && targetObject != null) | |
{ | |
(from sourceProperty in sourceObject.GetType().GetProperties().AsEnumerable() | |
from targetProperty in targetObject.GetType().GetProperties().AsEnumerable() | |
where sourceProperty.Name.ToUpper() == targetProperty.Name.ToUpper() | |
let sourceValue = sourceProperty.GetValue(sourceObject, null) | |
where sourceValue != null | |
select CopyProperty(targetProperty, targetObject, sourceValue, deepCopy)) |
NewerOlder