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
/// <summary> | |
/// Validates that record is found in Aleph by GetDigitalObjectFromAleph method | |
/// or user has processed it. | |
/// Filters records which were not found in Aleph by GetDigitalObjectFromAleph method | |
/// and not processed by user. | |
/// </summary> | |
/// <param name="codeTableCode">The code table code.</param> | |
/// <param name="value">The value.</param> | |
/// <param name="elementId">The element id.</param> | |
/// <param name="elementName">Name of the element.</param> |
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
protected override void ExecuteInContext(IUnitOfWorkContext context, RegisterNewAffairCmd cmd) | |
{ | |
var affair=Affair.RegisterAffair(cmd.AffairId, cmd.Name, cmd.Location); | |
//how to save it? :/ | |
context. | |
_repository.Save(affair); | |
context.Accept(); | |
} | |
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 Web.Bootstrap { | |
using CommandHandlers; | |
using Microsoft.Practices.ServiceLocation; | |
using MvcExtensions; | |
using Ncqrs; | |
using Ncqrs.Commanding.ServiceModel; | |
using Ncqrs.Config.StructureMap; | |
using Ncqrs.Domain; | |
using Ncqrs.Domain.Storage; | |
using Ncqrs.Eventing.ServiceModel.Bus; |
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 Interreg.Config{ | |
using System; | |
using System.IO; | |
using Domain; | |
using FluentNHibernate.Automapping; | |
using FluentNHibernate.Cfg; | |
using FluentNHibernate.Cfg.Db; | |
using FluentNHibernate.Conventions.Helpers; | |
using NHibernate; | |
using NHibernate.Context; |
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 Interreg.Web.Bootstrap{ | |
using System; | |
using Config; | |
using Microsoft.Practices.ServiceLocation; | |
using MvcExtensions; | |
using NHibernate; | |
using NHibernate.Context; | |
using StructureMap; | |
public class NHibernateTask:BootstrapperTask{ | |
private readonly IContainer _container; |
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 MyProject.Web.Binders{ | |
using System.Web.Mvc; | |
using Domain; | |
public class RootBinder<TRoot,TRepository>:DefaultModelBinder | |
where TRepository:IRepository<TRoot> where TRoot:IRoot{ | |
private readonly TRepository _repository; | |
public RootBinder(TRepository repository){ | |
Guard.AgainstNull(repository); | |
_repository=repository; | |
} |
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 MyProject.Web.Binders{ | |
using System.Web.Mvc; | |
using Domain; | |
public class RootBinder<TRoot,TRepository>:DefaultModelBinder | |
where TRepository:IRepository<TRoot> where TRoot:IRoot{ | |
private readonly TRepository _repository; | |
public RootBinder(TRepository repository){ | |
Guard.AgainstNull(repository); | |
_repository=repository; | |
} |
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
if ((sTemp.IndexOf(".") == -1) && (sTemp.Length >= 1) && | |
(sTemp.ToUpper().IndexOf("N") == -1) && (sTemp.IndexOf("-") == -1)) | |
{ | |
invRow.AT13 = true; | |
} | |
else | |
{ | |
invRow.AT13 = false; | |
} | |
sTemp = |
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
[HttpPost] | |
public ActionResult ReceivePaperVersion(Application a,ReceivePaperVersionInput inp){ | |
var r=new Func<ActionResult>(()=>RedirectToAction("Details",new {a.Id})); | |
return this.Do( | |
()=>{ | |
a.ReceivePaperVersion(inp.PaperVersionSendDate.Value,inp.PaperVersionArrivalDate.Value); | |
this.Flash("Application paper version received!"); | |
return r(); | |
},r); //1st arg==happy path, 2nd arg==onFail | |
} |
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
//class Application { | |
public virtual void ReceivePaperVersion(DateTime sendDate,DateTime arrivalDate){ | |
if(Statuses.ApplicationStatus!=ApplicationStatus.ReceivedElectronically) | |
throw new ApplicationException | |
("Paper version can be received only right after electronic version is received."); | |
var d=Call.ApplicationDeadlines; | |
if(sendDate>d.PaperVersionSendDeadline) | |
throw new ApplicationException("Send date exceeds call deadline"); | |
if(arrivalDate>d.PaperVersionArrivalDeadline) | |
throw new ApplicationException("Arrival date exceeds call deadline"); |
OlderNewer