Zbiór zmian 896 dla trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
- Data:
- 2009-11-24 12:24:57 (16 years ago)
- Pliki:
-
- 1 zmodyfikowane
-
trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (zmodyfikowane) (9 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
r888 r896 23 23 { 24 24 public const string ISPAID = "payment_deposited"; //transakcja potwierdzona do rozliczenia 25 private readonly PlatnosciDataContext _context; 26 private readonly IDataContext _context1; 27 private readonly IRepository<PotwierdzeniaEcard> _rep; 28 private readonly IRepository<PlatnosciEcard> _repPl; 25 private readonly IRepository<vPlatnosciEcard> _repVPayment; 26 private readonly IRepository<PlatnosciEcard> _repPayment; 27 private readonly IRepository<PotwierdzeniaEcard> _repConfirm; 29 28 private FunkcjePlatnosci _func; 30 29 private string weryfikacja; … … 37 36 public PlatnoscController() 38 37 { 39 _context = new PlatnosciDataContext(); 40 _rep = new Repository<PotwierdzeniaEcard>(new DataContext1()); 41 _repPl = new Repository<PlatnosciEcard>(new DataContext1()); 42 _func = new FunkcjePlatnosci(); 43 44 } 45 public PlatnoscController(IDataContext datacontext, int czy_test) 46 { 47 _rep = new Repository<PotwierdzeniaEcard>(datacontext); 48 _repPl = new Repository<PlatnosciEcard>(datacontext); 49 _context1 = datacontext; 38 _repVPayment = new Repository<vPlatnosciEcard>(new DataContext1()); 39 _repPayment = new Repository<PlatnosciEcard>(new DataContext1()); 40 _repConfirm = new Repository<PotwierdzeniaEcard>(new DataContext1()); 41 _func = new FunkcjePlatnosci(); 42 } 43 public PlatnoscController(IRepository<vPlatnosciEcard> repVPayment, IRepository<PlatnosciEcard> repPayment, IRepository<PotwierdzeniaEcard> repConfirm, int czy_test) 44 { 45 _repVPayment = repVPayment; 46 _repPayment = repPayment; 47 _repConfirm = repConfirm; 50 48 _func = new FunkcjePlatnosci(); 51 49 test = czy_test; … … 57 55 int id1 = ConvertId(id); 58 56 59 vPlatnosciEcard platnosc = _rep .FindInvoiceById(id1).SingleOrDefault();57 vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault(); 60 58 if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc)); 61 59 … … 65 63 var invoiceDeatailsViewData = InitInvoiceDetailsViewData(platnosc, payer, "", kwota); 66 64 67 var tablica_potwierdzenia = _rep .FindItemsByIdFaktury(id1);65 var tablica_potwierdzenia = _repConfirm.FindItemsByIdFaktury(id1); 68 66 if (tablica_potwierdzenia.Count > 0) //platnosc za fakture zostala uregulowana 69 67 { … … 81 79 language = _func.setLanguage(language); 82 80 ustawTlumaczenia(test); 83 vPlatnosciEcard platnosc = _rep .FindInvoiceById(payer.Id_faktury).SingleOrDefault();81 vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == payer.Id_faktury).SingleOrDefault(); 84 82 if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc)); 85 83 … … 111 109 ustawTlumaczenia(test); 112 110 int id1 = ConvertId(id); 113 vPlatnosciEcard platnosc = _rep .FindInvoiceById(id1).SingleOrDefault();111 vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault(); 114 112 if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc)); 115 113 … … 122 120 ustawTlumaczenia(test); 123 121 int id1 = ConvertId(id); 124 vPlatnosciEcard platnosc = _rep .FindInvoiceById(id1).SingleOrDefault();122 vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault(); 125 123 if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc)); 126 124 … … 163 161 potwierdzenie.WITHCVC = WITHCVC; 164 162 165 _rep .Insert(potwierdzenie);163 _repConfirm.Insert(potwierdzenie); 166 164 UpdateStatus(ORDERNUMBER, CURRENTSTATE); 167 165 return View(); … … 229 227 public void UpdateStatus(int ordernumber, string currentstate) 230 228 { 231 PlatnosciEcard platnosc = _repP l.FindOne(ordernumber);229 PlatnosciEcard platnosc = _repPayment.Find(p => p.ORDERNUMBER == ordernumber).SingleOrDefault(); 232 230 if (platnosc != null && currentstate == ISPAID) 233 231 { 234 232 platnosc.Status = true; 235 233 platnosc.Status_data = DateTime.Now; 236 _repP l.SubmitChanges();234 _repPayment.SubmitChanges(); 237 235 238 236 System.Diagnostics.Debug.WriteLine("IsUpdate");
