Index: trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs (revision 966)
+++ trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs (revision 970)
@@ -1,10 +1,11 @@
 ﻿using System;
 using System.Web;
-using Platnosci.Core.Linq;
 using System.Threading;
 using System.Globalization;
 using System.Configuration;
 using System.Security.Principal;
-using Platnosci.Core.Interface;
+using adMoto.Payments.Core;
+using adMoto.Payments.Core.Data;
+using adMoto.Payments.Core.Interfaces;
 
 
@@ -50,10 +51,10 @@
         }
 
-        public bool UserIdentity(vPlatnosciEcard platnosc, string userName)
+        public bool UserIdentity(Invoice platnosc, string userName)
         {
             return platnosc != null && platnosc.nip == userName;
         }
 
-        public Waluta SetAmount(vPlatnosciEcard platnosc)
+        public Waluta SetAmount(Invoice platnosc)
         {
             var waluta = new Waluta();
@@ -122,8 +123,13 @@
             var css = ConfigurationManager.AppSettings["Css"];
 
-            if (css == "truck") 
-                str = HttpContext.GetGlobalResourceObject("tlumaczenia", "adresTruck") + " - ";
-            else if (css == "admoto") 
-                str = HttpContext.GetGlobalResourceObject("tlumaczenia", "adresAdmoto") + " - ";
+            switch (css)
+            {
+                case "truck":
+                    str = HttpContext.GetGlobalResourceObject("tlumaczenia", "adresTruck") + " - ";
+                    break;
+                case "admoto":
+                    str = HttpContext.GetGlobalResourceObject("tlumaczenia", "adresAdmoto") + " - ";
+                    break;
+            }
 
             return str;
@@ -142,5 +148,5 @@
             return er;
         }
-        public PlatnosciEcard CreateAndAddNewPyment(vPlatnosciEcard platnosc, Waluta waluta, Payer payer, string sessionId)
+        public PlatnosciEcard CreateAndAddNewPyment(Invoice platnosc, Waluta waluta, Payer payer, string sessionId)
         {
             var newPayment = new PlatnosciEcard();
@@ -167,5 +173,6 @@
             return newPayment;
         }
-        public ErrorViewData IsError(vPlatnosciEcard platnosc, String UserName)
+
+        public ErrorViewData IsError(Invoice platnosc, String UserName)
         {
             var errortxt = "";
@@ -178,12 +185,13 @@
             return InitErrorViewData(errortxt, 0);
         }
+
         public string GetLanguage()
         {
-            string language = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToUpper();
+            var language = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToUpper();
             
             if (language != "PL" && language != "EN" && language != "DE")
                 return "PL";  //domyślny jezyk, w ktorym ma byc wyświetlony formularz na stronie eCard
-            else 
-                return language;
+            
+            return language;
         }
     }
Index: trunk/eCard/eCardMVC/Platnosci/Models/InvoiceDetailsViewData.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Models/InvoiceDetailsViewData.cs (revision 951)
+++ trunk/eCard/eCardMVC/Platnosci/Models/InvoiceDetailsViewData.cs (revision 970)
@@ -1,9 +1,4 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Mvc;
-using Platnosci.Core.Linq;
-
+﻿using adMoto.Payments.Core;
+using adMoto.Payments.Core.Data;
 
 namespace Platnosci.Models
@@ -11,5 +6,5 @@
     public class InvoiceDetailsViewData
     {
-        public vPlatnosciEcard vPlatnosciEcard { get; set; }
+        public Invoice vPlatnosciEcard { get; set; }
         public Payer Payer {get; set;}
         public string brutto { get; set; }
Index: trunk/eCard/eCardMVC/Platnosci/Models/eCardData.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Models/eCardData.cs (revision 968)
+++ trunk/eCard/eCardMVC/Platnosci/Models/eCardData.cs (revision 970)
@@ -4,6 +4,7 @@
 using System.Linq;
 using System.Configuration;
-using Platnosci.Core.Linq;
-using Platnosci.Core.Interface;
+using adMoto.Payments.Core;
+using adMoto.Payments.Core.Data;
+using adMoto.Payments.Core.Interfaces;
 
 namespace Platnosci.Models
@@ -38,5 +39,5 @@
             return dane;
         }
-        public Merchant CreateMerchantData(vPlatnosciEcard invoice, Payer payer, string lang, string sessionId)
+        public Merchant CreateMerchantData(Invoice invoice, Payer payer, string lang, string sessionId)
         {
             var merchant = new Merchant();
Index: trunk/eCard/eCardMVC/Platnosci/Controllers/AccountController.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Controllers/AccountController.cs (revision 950)
+++ trunk/eCard/eCardMVC/Platnosci/Controllers/AccountController.cs (revision 970)
@@ -3,7 +3,8 @@
 using System.Web.Mvc;
 using System.Web.Security;
-using Platnosci.Core.Linq;
+using adMoto.Payments.Core;
+using adMoto.Payments.Core.Data;
+using adMoto.Payments.Core.Interfaces;
 using Platnosci.Models;
-using Platnosci.Core.Interface;
 
 namespace Platnosci.Controllers
@@ -12,5 +13,5 @@
     public class AccountController : Controller
     {
-        private readonly IRepository<vPlatnosciEcard> _repository;
+        private readonly IRepository<Invoice> _repository;
         private readonly FunkcjePlatnosci _funkcjePlatnosci;
 
@@ -23,10 +24,10 @@
         public AccountController()
         {
-            _repository = new Repository<vPlatnosciEcard>(new DataContext());
+            _repository = new Repository<Invoice>(new DataContext());
             FormsAuth = new FormsAuthenticationService();
             _funkcjePlatnosci = new FunkcjePlatnosci();
         }
 
-        public AccountController(IFormsAuthentication formsAuth, IRepository<vPlatnosciEcard> repository, FunkcjePlatnosci func)
+        public AccountController(IFormsAuthentication formsAuth, IRepository<Invoice> repository, FunkcjePlatnosci func)
         {
             _repository = repository;
@@ -50,5 +51,5 @@
         {
             _funkcjePlatnosci.SetLanguage(language);
-            var platnosc = new vPlatnosciEcard();
+            var platnosc = new Invoice();
             if (!ValidateLogOn(nip, numerFaktury))
             {
Index: trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs (revision 959)
+++ trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs (revision 970)
@@ -2,11 +2,8 @@
 using System.Linq;
 using System.Web.Mvc;
+using adMoto.Payments.Core;
+using adMoto.Payments.Core.Data;
+using adMoto.Payments.Core.Interfaces;
 using Platnosci.Models;
-using Platnosci.Core.Linq;
-using Platnosci.Core.Interface;
-using System.Configuration;
-using System.Net;
-using System.IO;
-using System.Threading;
 
 namespace Platnosci.Controllers
@@ -15,5 +12,5 @@
     public class MerchantController : Controller
     {
-        private readonly IRepository<vPlatnosciEcard> _repVPayment;
+        private readonly IRepository<Invoice> _repVPayment;
         private readonly IRepository<PlatnosciEcard> _repPayment; 
         private readonly FunkcjePlatnosci _funkcjePlatnosci;
@@ -23,5 +20,5 @@
         public MerchantController()
         {
-            _repVPayment = new Repository<vPlatnosciEcard>(new DataContext());
+            _repVPayment = new Repository<Invoice>(new DataContext());
             _repPayment = new Repository<PlatnosciEcard>(new DataContext());
             _funkcjePlatnosci = new FunkcjePlatnosci(_repPayment);
@@ -29,5 +26,5 @@
             _eCardData = new eCardData(_repPayment);
         }
-        public MerchantController(IRepository<vPlatnosciEcard> repVPayment, IRepository<PlatnosciEcard> repPayment, ITranslateManager translate)
+        public MerchantController(IRepository<Invoice> repVPayment, IRepository<PlatnosciEcard> repPayment, ITranslateManager translate)
         {
             _repVPayment = repVPayment;
Index: trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (revision 969)
+++ trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (revision 970)
@@ -1,20 +1,17 @@
 using System;
 using System.Linq;
-using System.Web;
 using System.Web.Mvc;
+using adMoto.Payments.Core;
+using adMoto.Payments.Core.Data;
+using adMoto.Payments.Core.Interfaces;
 using Elmah;
 using Platnosci.Models;
-using Platnosci.Core.Linq;
-using Platnosci.Core.Interface;
-using ApplicationException=Elmah.ApplicationException;
 
 namespace Platnosci.Controllers
 {
-
-    //[Authorize]
     public class PlatnoscController : Controller
     {
         public const string ISPAID = "payment_deposited";       //transakcja potwierdzona do rozliczenia
-        private readonly IRepository<vPlatnosciEcard> _repVPayment;
+        private readonly IRepository<Invoice> _repVPayment;
         private readonly IRepository<PlatnosciEcard> _repPayment;
         private readonly IRepository<PotwierdzeniaEcard> _repConfirm;
@@ -24,5 +21,5 @@
         public PlatnoscController()
         {
-            _repVPayment = new Repository<vPlatnosciEcard>(new DataContext());
+            _repVPayment = new Repository<Invoice>(new DataContext());
             _repPayment = new Repository<PlatnosciEcard>(new DataContext());
             _repConfirm = new Repository<PotwierdzeniaEcard>(new DataContext());
@@ -30,5 +27,5 @@
             _translateManager = new Translation();
         }
-        public PlatnoscController(IRepository<vPlatnosciEcard> repVPayment, IRepository<PlatnosciEcard> repPayment, IRepository<PotwierdzeniaEcard> repConfirm, ITranslateManager translate)
+        public PlatnoscController(IRepository<Invoice> repVPayment, IRepository<PlatnosciEcard> repPayment, IRepository<PotwierdzeniaEcard> repConfirm, ITranslateManager translate)
         {
             _repVPayment = repVPayment;
@@ -64,4 +61,5 @@
             return View(invoiceDeatailsViewData);
         }
+
         [Authorize]
         [AcceptVerbs(HttpVerbs.Post)]
@@ -139,5 +137,6 @@
         public ActionResult Status()
         {
-            ErrorSignal.FromCurrentContext().Raise(new Exception(), System.Web.HttpContext.Current);
+            if (System.Web.HttpContext.Current != null)
+                ErrorSignal.FromCurrentContext().Raise(new Exception(), System.Web.HttpContext.Current);
 
             var potwierdzenie = new PotwierdzeniaEcard();
@@ -201,5 +200,5 @@
         }
 
-        private InvoiceDetailsViewData InitInvoiceDetailsViewData(vPlatnosciEcard platnosc)
+        private InvoiceDetailsViewData InitInvoiceDetailsViewData(Invoice platnosc)
         {
             var invoiceDeatailsViewData = new InvoiceDetailsViewData();
Index: trunk/eCard/eCardMVC/Platnosci/Platnosci.Web.csproj
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Platnosci.Web.csproj (revision 969)
+++ trunk/eCard/eCardMVC/Platnosci/Platnosci.Web.csproj (revision 970)
@@ -129,10 +129,4 @@
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\Platnosci.Core\Platnosci.Core.csproj">
-      <Project>{329506B5-F705-46AE-A31D-799141FEA70E}</Project>
-      <Name>Platnosci.Core</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
     <Content Include="Content\admoto.css" />
     <Content Include="Content\truck.css" />
@@ -187,4 +181,10 @@
     <Content Include="Views\Platnosc\Paid.aspx" />
     <Content Include="Views\Platnosc\Status.aspx" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\adMoto.Payments.Core\adMoto.Payments.Core.csproj">
+      <Project>{C14BEFFA-8EAC-4E07-AEB2-27D2B3E46469}</Project>
+      <Name>adMoto.Payments.Core</Name>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
