Index: trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (revision 888)
+++ trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (revision 896)
@@ -23,8 +23,7 @@
     {
         public const string ISPAID = "payment_deposited";       //transakcja potwierdzona do rozliczenia
-        private readonly PlatnosciDataContext _context;
-        private readonly IDataContext _context1;
-        private readonly IRepository<PotwierdzeniaEcard> _rep;
-        private readonly IRepository<PlatnosciEcard> _repPl;
+        private readonly IRepository<vPlatnosciEcard> _repVPayment;       
+        private readonly IRepository<PlatnosciEcard> _repPayment;
+        private readonly IRepository<PotwierdzeniaEcard> _repConfirm;       
         private FunkcjePlatnosci _func;
         private string weryfikacja;
@@ -37,15 +36,14 @@
         public PlatnoscController()
         {
-            _context = new PlatnosciDataContext();
-            _rep = new Repository<PotwierdzeniaEcard>(new DataContext1());
-            _repPl = new Repository<PlatnosciEcard>(new DataContext1());
-            _func = new FunkcjePlatnosci();
-                      
-        }
-        public PlatnoscController(IDataContext datacontext, int czy_test)
-        {
-            _rep = new Repository<PotwierdzeniaEcard>(datacontext);
-            _repPl = new Repository<PlatnosciEcard>(datacontext);
-            _context1 = datacontext;
+            _repVPayment = new Repository<vPlatnosciEcard>(new DataContext1());
+            _repPayment = new Repository<PlatnosciEcard>(new DataContext1());
+            _repConfirm = new Repository<PotwierdzeniaEcard>(new DataContext1());
+            _func = new FunkcjePlatnosci();                      
+        }
+        public PlatnoscController(IRepository<vPlatnosciEcard> repVPayment, IRepository<PlatnosciEcard> repPayment, IRepository<PotwierdzeniaEcard> repConfirm, int czy_test)
+        {
+            _repVPayment = repVPayment;
+            _repPayment = repPayment;
+            _repConfirm = repConfirm;
             _func = new FunkcjePlatnosci();
             test = czy_test;
@@ -57,5 +55,5 @@
             int id1 = ConvertId(id);
 
-            vPlatnosciEcard platnosc = _rep.FindInvoiceById(id1).SingleOrDefault();
+            vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault();
             if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc));
 
@@ -65,5 +63,5 @@
             var invoiceDeatailsViewData = InitInvoiceDetailsViewData(platnosc, payer, "", kwota);  
 
-            var tablica_potwierdzenia = _rep.FindItemsByIdFaktury(id1);
+            var tablica_potwierdzenia = _repConfirm.FindItemsByIdFaktury(id1);
             if (tablica_potwierdzenia.Count > 0) //platnosc za fakture zostala uregulowana
             {
@@ -81,5 +79,5 @@
             language = _func.setLanguage(language);
             ustawTlumaczenia(test);
-            vPlatnosciEcard platnosc = _rep.FindInvoiceById(payer.Id_faktury).SingleOrDefault();
+            vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == payer.Id_faktury).SingleOrDefault();
             if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc));
             
@@ -111,5 +109,5 @@
             ustawTlumaczenia(test);
             int id1 = ConvertId(id);
-            vPlatnosciEcard platnosc = _rep.FindInvoiceById(id1).SingleOrDefault();
+            vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault();
             if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc));            
             
@@ -122,5 +120,5 @@
             ustawTlumaczenia(test);
             int id1 = ConvertId(id);
-            vPlatnosciEcard platnosc = _rep.FindInvoiceById(id1).SingleOrDefault();
+            vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault();
             if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc));
             
@@ -163,5 +161,5 @@
             potwierdzenie.WITHCVC = WITHCVC;
 
-            _rep.Insert(potwierdzenie);
+            _repConfirm.Insert(potwierdzenie);
             UpdateStatus(ORDERNUMBER, CURRENTSTATE);
             return View();
@@ -229,10 +227,10 @@
         public void UpdateStatus(int ordernumber, string currentstate)
         {
-            PlatnosciEcard platnosc = _repPl.FindOne(ordernumber);
+            PlatnosciEcard platnosc = _repPayment.Find(p => p.ORDERNUMBER == ordernumber).SingleOrDefault();
             if (platnosc != null && currentstate == ISPAID)
             {
                 platnosc.Status = true;
                 platnosc.Status_data = DateTime.Now;
-                _repPl.SubmitChanges();
+                _repPayment.SubmitChanges();
                 
                 System.Diagnostics.Debug.WriteLine("IsUpdate");
