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 Map=BudgetPerPartnersMap; | |
//you all going to die down here! | |
public static class BudgetPerPartnersReader{ | |
public static void Read(IExcelReader r,ApplicationForm f){ | |
r.ChangeSheet(SheetMap.BudgetPerPartners); | |
var b=f.BudgetPerPartners; | |
var fillCostsType=new Action<CostsType,string[,]>( | |
(costsType,map)=>{ | |
costsType.AllPartnersTotal=r.Get(Map.AllPartnersTotal[0]); | |
for(var i=0;i<map.GetUpperBound(0);i++) |
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 Interreg.Infra.Forms{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using Microsoft.Office.Interop.Excel; | |
public interface IExcelReader:IDisposable{ | |
void Open(string path); | |
string Get(string key); | |
void ChangeSheet(string key); |
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 UserSession:IUserSession{ | |
private readonly IAuthenticationService _authenticationService; | |
private readonly ICryptographer _crypto; | |
private readonly IUserRepository _repository; | |
public UserSession(IUserRepository repository,IAuthenticationService authenticationService,ICryptographer crypto){ | |
Guard.AgainstNull(repository); | |
Guard.AgainstNull(authenticationService); | |
Guard.AgainstNull(crypto); | |
_repository=repository; | |
_crypto=crypto; |
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 Interreg.Web{ | |
using System; | |
using System.Security.Principal; | |
using System.Web.Security; | |
using MvcExtensions.StructureMap; | |
public class MvcApplication:StructureMapMvcApplication{ | |
//ignore this bullshit code... | |
protected void Application_AuthenticateRequest(Object sender,EventArgs e){ | |
var authCookie=Context.Request.Cookies[FormsAuthentication.FormsCookieName]; | |
if(authCookie==null||authCookie.Value=="") return; |
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.IO; | |
public class TempDirectory:IDisposable{ | |
private readonly string _path; | |
public TempDirectory(){ | |
var path=Path.Combine(Path.GetTempPath(),Path.GetRandomFileName()); | |
Directory.CreateDirectory(path); | |
_path=path; | |
} | |
public void Dispose(){ |
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Xml.Linq; | |
public class WordTemplateFiller{ | |
private readonly Zipper _zipper=new Zipper(); | |
private const string _pathToCustomPropXml="docprops\\custom.xml"; | |
/// <returns>path to filled docx</returns> | |
public FileInfo FillTemplate(string templatePath,Dictionary<string,string> props){ | |
var docPath=Path.GetTempFileName(); |
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 Interreg.App.Audit.Application{ | |
using Domain.Model.Applications; | |
public class ApplicationAudit:Audit{ | |
public override void AttachHandlers(){ | |
On<AttachmentAdded>(e=>e.Source.LogEvent( | |
"Attachment named '{0}' added".With(e.Attachment.Name))); | |
On<AttachmentRemoved>(e=>e.Source.LogEvent( | |
"Attachment named '{0}' removed".With(e.Attachment.Name))); |
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 Show{ | |
public Show(DateTime startsOn, DateTime endsOn, string location, ShowType showType){ | |
StartsOn = startsOn; | |
EndsOn = endsOn; | |
Location = location; | |
ShowType = showType; | |
Speakers = new List<Speaker>(); | |
Attendees = new List<Attendee>(); | |
AssociatedCampaigns = new List<Campaign>(); | |
} |
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
//view | |
@model StateIneligibilityModel | |
@Html.Js("ineligibilities/state") | |
@using (Html.BeginForm("State", "Ineligibilities", FormMethod.Post)){ | |
<fieldset class="state-ineligibility"> | |
<legend>State ineligibility:</legend> | |
@Html.HiddenFor(x=>x.Project) | |
<table> | |
<tr> | |
<td>@Html.LabelFor(x=>x.IneligibleCosts)</td> |
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 Interreg.Integration.Web.Routing{ | |
using Extensions; | |
using Interreg.Web.Controllers; | |
using Xunit; | |
public class ApplicationsFacts:Base{ | |
[Fact] | |
public void Application(){ | |
"~/Applications/1" | |
.ShouldMapTo<ApplicationsController>(c=>c.Application(null,null)); | |
} |