Zbiór zmian 871 dla trunk/eCard/eCardMVC

Pokaż
Ignoruj:
Data:
2009-11-09 16:00:17 (16 years ago)
Autor:
alina
Opis:

re #215

Lokalizacja:
trunk/eCard/eCardMVC
Pliki:
9 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/Platnosci.Core/Platnosci.Core.csproj

    r870 r871  
    3333  </PropertyGroup> 
    3434  <ItemGroup> 
     35    <Reference Include="Elmah, Version=1.1.11517.0, Culture=neutral, processorArchitecture=MSIL"> 
     36      <SpecificVersion>False</SpecificVersion> 
     37      <HintPath>..\..\..\..\Documents and Settings\Administrator\Pulpit\bin\net-3.5\Debug\Elmah.dll</HintPath> 
     38    </Reference> 
    3539    <Reference Include="System" /> 
    3640    <Reference Include="System.Data" /> 
     
    6569    <Compile Include="Interface\IDataContext.cs" /> 
    6670    <Compile Include="Interface\IIdentifiable.cs" /> 
    67     <Compile Include="Interface\IRep.cs" /> 
    6871    <Compile Include="Interface\IRepository.cs" /> 
    6972    <Compile Include="Linq\DataContext1.cs" /> 
    70     <Compile Include="Linq\FakeDataContext.cs" /> 
    7173    <Compile Include="Linq\Payer.cs" /> 
    7274    <Compile Include="Linq\Platnosci.cs"> 
     
    8183    <Compile Include="Linq\PlatnosciEcard.cs" /> 
    8284    <Compile Include="Linq\PotwierdzeniaEcard.cs" /> 
    83     <Compile Include="Linq\Rep.cs" /> 
    8485    <Compile Include="Linq\Repository.cs" /> 
    8586    <Compile Include="Linq\vPlatnosciEcard.cs" /> 
  • trunk/eCard/eCardMVC/Platnosci.Tests/Platnosci.Tests.csproj

    r866 r871  
    6565    <Reference Include="System.Data" /> 
    6666    <Reference Include="System.Xml" /> 
     67    <Reference Include="WatiN.Core, Version=2.0.10.928, Culture=neutral, PublicKeyToken=db7cfd3acb5ad44e, processorArchitecture=x86"> 
     68      <SpecificVersion>False</SpecificVersion> 
     69      <HintPath>..\..\..\..\Documents and Settings\Administrator\Pulpit\WatiN-2.0.10.928-net-2.0\bin\WatiN.Core.dll</HintPath> 
     70    </Reference> 
    6771  </ItemGroup> 
    6872  <ItemGroup> 
    6973    <Compile Include="Properties\AssemblyInfo.cs" /> 
     74    <Compile Include="Web\FakeDataContext.cs" /> 
    7075    <Compile Include="Web\PlatnosciControllerTests.cs" /> 
    7176  </ItemGroup> 
     
    8085    </ProjectReference> 
    8186  </ItemGroup> 
     87  <ItemGroup> 
     88    <Content Include="app.config" /> 
     89  </ItemGroup> 
    8290  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 
    8391  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.  
  • trunk/eCard/eCardMVC/Platnosci.Tests/Web/PlatnosciControllerTests.cs

    r870 r871  
    1111using Platnosci.Core.Interface; 
    1212using Platnosci.Core.Linq; 
     13using WatiN.Core; 
     14using System.Threading; 
     15using Platnosci.Models; 
     16using Rhino.Mocks; 
    1317 
    1418namespace Platnosci.Tests.Web 
    1519{ 
    1620    [TestFixture] 
     21    
    1722    class PlatnosciControllerTests 
    1823    { 
    19          private string merchantNumber = "123"; 
     24        private string merchantNumber = "123"; 
     25        private FunkcjePlatnosci _func = new FunkcjePlatnosci(); 
    2026 
    2127         /*[TearDown] 
     
    3137         } 
    3238        */ 
    33          [Test] 
    34          public void Status_Saves_Correct_Transaction() 
    35          { 
    36              
    37              var orderNumber = 9999; 
    38              FakeDataContext fake = new FakeDataContext(); 
    39              var builder = new TestControllerBuilder(); 
    40              var controller = new PlatnoscController(fake); 
    41              builder.InitializeController(controller); 
    42              builder.Form.Add("MERCHANTNUMBER", merchantNumber.ToString()); 
    43              builder.Form.Add("AUTHTIME", DateTime.Now.ToString()); 
    44              builder.Form.Add("DATATRANSMISJI", DateTime.Now.ToString()); 
    45              builder.Form.Add("ORDERNUMBER", orderNumber.ToString()); 
    46  
    47              var result = controller.Status(); 
    48  
    49              IRepository<PotwierdzeniaEcard> _rep = new Repository<PotwierdzeniaEcard>(fake);             
    50              var potwierdzeniaEcard = _rep.Find(p => p.ORDERNUMBER == orderNumber).First(); 
    51              Assert.That(potwierdzeniaEcard.MERCHANTNUMBER, Is.EqualTo(merchantNumber));             
    52          }  
    53         [Test] 
     39        
     40 
     41        [Test] 
     42        [Category("Unit")] 
     43        public void Status_Saves_Correct_Transaction() 
     44        {           
     45            var orderNumber = 9999; 
     46            FakeDataContext fake = new FakeDataContext(); 
     47            var builder = new TestControllerBuilder(); 
     48            var controller = new PlatnoscController(fake); 
     49            builder.InitializeController(controller); 
     50            builder.Form.Add("MERCHANTNUMBER", merchantNumber.ToString()); 
     51            builder.Form.Add("AUTHTIME", DateTime.Now.ToString()); 
     52            builder.Form.Add("DATATRANSMISJI", DateTime.Now.ToString()); 
     53            builder.Form.Add("ORDERNUMBER", orderNumber.ToString()); 
     54 
     55            var result = controller.Status(); 
     56 
     57            IRepository<PotwierdzeniaEcard> _rep = new Repository<PotwierdzeniaEcard>(fake);             
     58            var potwierdzeniaEcard = _rep.Find(p => p.ORDERNUMBER == orderNumber).First(); 
     59            Assert.That(potwierdzeniaEcard.MERCHANTNUMBER, Is.EqualTo(merchantNumber));             
     60        } 
     61        [Test] 
     62        [Category("Unit")] 
     63        public void StatusIsUpdated() 
     64        { 
     65            FakeDataContext fake = new FakeDataContext(); 
     66            IRepository<PlatnosciEcard> _rep = new Repository<PlatnosciEcard>(fake); 
     67              
     68            DateTime data = DateTime.Now; 
     69 
     70            PlatnosciEcard platnosc = new PlatnosciEcard(); 
     71            platnosc.ORDERNUMBER = 1; 
     72            platnosc.Status = true; 
     73            platnosc.Status_data = data; 
     74            _rep.Insert(platnosc); 
     75 
     76            var builder = new TestControllerBuilder(); 
     77            var controller = new PlatnoscController(fake); 
     78            builder.InitializeController(controller);          
     79 
     80            controller.UpdateStatus(1, "000");   //000 - płatność poprawna 
     81 
     82            PlatnosciEcard payment_after_update = new PlatnosciEcard(); 
     83            payment_after_update = _rep.FindOne(i => i.ORDERNUMBER == 1); 
     84            Assert.That(payment_after_update.Status_data, Is.GreaterThan(data)); 
     85        } 
     86        [Test] 
     87        [Category("Unit")] 
     88        public void StatusIsNotUpdated() 
     89        { 
     90            FakeDataContext fake = new FakeDataContext(); 
     91            IRepository<PlatnosciEcard> _rep = new Repository<PlatnosciEcard>(fake); 
     92 
     93            DateTime data = DateTime.Now; 
     94 
     95            PlatnosciEcard platnosc = new PlatnosciEcard(); 
     96            platnosc.ORDERNUMBER = 1; 
     97            platnosc.Status = true; 
     98            platnosc.Status_data = data; 
     99            _rep.Insert(platnosc); 
     100 
     101            var builder = new TestControllerBuilder(); 
     102            var controller = new PlatnoscController(fake); 
     103            builder.InitializeController(controller); 
     104 
     105            controller.UpdateStatus(1, "111");   //111 - płatność niepoprawna, ze wzgledu na zly numer karty 
     106 
     107            PlatnosciEcard payment_after_update = new PlatnosciEcard(); 
     108            payment_after_update = _rep.FindOne(i => i.ORDERNUMBER == 1); 
     109            Assert.That(payment_after_update.Status_data, Is.EqualTo(data)); 
     110 
     111        } 
     112         
     113        [Test] 
     114        [Category("Unit")] 
    54115        public void NumerFaktury() 
    55116        { 
     
    59120             vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
    60121             platnosc = _rep.FindInvoiceById(1).SingleOrDefault(); 
    61              Assert.That(platnosc.Faktura_Numer, Is.EqualTo("222/2")); 
    62         } 
    63         [Test] 
     122             Assert.That(platnosc.Faktura_Numer, Is.EqualTo("1")); 
     123        } 
     124        [Test] 
     125        [Category("Unit")] 
    64126        public void AddPayment() 
    65127        { 
     
    80142            Assert.That(pl.nip, Is.EqualTo("nipek")); 
    81143        } 
    82          
     144        [Test] 
     145        [Category("Unit")] 
     146        public void ShowPayment_BadNip() 
     147        { 
     148            FakeDataContext fake = new FakeDataContext(); 
     149            IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
     150 
     151            vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
     152            platnosc.ID_faktury = 74828; 
     153            platnosc.nip = "854956281"; 
     154            platnosc.Faktura_Numer = "27/ASZ/2009"; 
     155            _rep.Insert(platnosc); 
     156 
     157            var builder = new TestControllerBuilder(); 
     158            var controller = new PlatnoscController(fake); 
     159            controller.setUserIdentity("122"); 
     160            controller.setWeryfikacja("Niepoprawny nip");  
     161            builder.InitializeController(controller); 
     162             
     163            var result = controller.Show("74828","pl") as ViewResult; 
     164            var error = (ErrorViewData)result.ViewData.Model; 
     165             
     166            Assert.That(error.error, Is.EqualTo("Niepoprawny nip"));           
     167 
     168        } 
     169        [Test] 
     170        [Category("Unit")] 
     171        public void ShowPayment_CorrectData() 
     172        { 
     173            FakeDataContext fake = new FakeDataContext(); 
     174            IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
     175 
     176            vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
     177            platnosc.ID_faktury = 74828; 
     178            platnosc.nip = "854956281"; 
     179            platnosc.Faktura_Numer = "27/ASZ/2009"; 
     180            platnosc.Brutto = 200; 
     181            _rep.Insert(platnosc); 
     182 
     183            var builder = new TestControllerBuilder(); 
     184            var controller = new PlatnoscController(fake); 
     185            controller.setUserIdentity("854956281"); 
     186            builder.InitializeController(controller); 
     187 
     188            var result = controller.Show("74828", "pl") as ViewResult; 
     189            var view = (InvoiceDetailsViewData)result.ViewData.Model; 
     190 
     191            Assert.That(view.vPlatnosciEcard.Brutto, Is.EqualTo(200)); 
     192            Assert.That(view.vPlatnosciEcard.Faktura_Numer, Is.EqualTo("27/ASZ/2009")); 
     193 
     194        } 
     195        [Test] 
     196        [Category("Unit")] 
     197        public void PaymentIsNotValid() 
     198        { 
     199            FakeDataContext fake = new FakeDataContext(); 
     200            IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
     201 
     202            vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
     203            platnosc.ID_faktury = 74828; 
     204            platnosc.nip = "854956281"; 
     205            platnosc.Faktura_Numer = "27/ASZ/2009"; 
     206            platnosc.Brutto = 200; 
     207            platnosc.SystemKsiegowyId = 2; 
     208            _rep.Insert(platnosc); 
     209 
     210            var builder = new TestControllerBuilder(); 
     211            var controller = new PlatnoscController(fake); 
     212            controller.setUserIdentity("854956281"); 
     213            builder.InitializeController(controller); 
     214 
     215            Payer payer = new Payer(); 
     216            payer.Id_faktury = 74828; 
     217            payer.LastName = "test";  //Nie wprowadzono imienia 
     218 
     219            controller.Show(payer, "pl"); 
     220            Assert.That(controller.ModelState.IsValid, Is.False); 
     221        } 
     222        [Test] 
     223        [Category("Unit")] 
     224        public void PaymentIsValid() 
     225        { 
     226            FakeDataContext fake = new FakeDataContext(); 
     227            IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
     228 
     229            vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
     230            platnosc.ID_faktury = 74828; 
     231            platnosc.nip = "854956281"; 
     232            platnosc.Faktura_Numer = "27/ASZ/2009"; 
     233            platnosc.Brutto = 200; 
     234            platnosc.SystemKsiegowyId = 2; 
     235            _rep.Insert(platnosc); 
     236 
     237            var builder = new TestControllerBuilder(); 
     238            var controller = new PlatnoscController(fake); 
     239            controller.setUserIdentity("854956281"); 
     240            builder.InitializeController(controller); 
     241 
     242            Payer payer = new Payer(); 
     243            payer.Id_faktury = 74828; 
     244            payer.LastName = "test"; 
     245            payer.FirstName = "test"; 
     246 
     247            controller.Show(payer, "pl"); 
     248            Assert.That(controller.ModelState.IsValid, Is.True);  
     249        } 
     250        [Test] 
     251        [Category("Unit")] 
     252        public void ShowPayment_BadId() 
     253        { 
     254            FakeDataContext fake = new FakeDataContext(); 
     255            IRepository<vPlatnosciEcard> _rep = new Repository<vPlatnosciEcard>(fake); 
     256 
     257            vPlatnosciEcard platnosc = new vPlatnosciEcard(); 
     258            platnosc.ID_faktury = 74828; 
     259            platnosc.nip = "854956281"; 
     260            platnosc.Faktura_Numer = "27/ASZ/2009"; 
     261            _rep.Insert(platnosc); 
     262 
     263            var builder = new TestControllerBuilder(); 
     264            var controller = new PlatnoscController(fake); 
     265            controller.setUserIdentity("1"); 
     266            controller.setWeryfikacja("Nie ma takiej platnosci."); 
     267            builder.InitializeController(controller); 
     268 
     269            var result = controller.Show("1", "pl") as ViewResult; 
     270            var error = (ErrorViewData)result.ViewData.Model; 
     271 
     272            Assert.That(error.error, Is.EqualTo("Nie ma takiej platnosci.")); 
     273 
     274        } 
     275        [Test] 
     276        [Category("UI")] 
     277        public void checkLoginCorrect() 
     278        { 
     279            IE ie = new IE("http://localhost:3646/pl/Account/LogOn"); 
     280            ie.TextField(Find.ByName("numer_faktury")).TypeText("24/HOL/2009"); 
     281            ie.TextField(Find.ByName("nip")).TypeText("501379568"); 
     282            ie.Button(Find.ById("but")).Click(); 
     283 
     284            Assert.IsTrue(ie.ContainsText("została uregulowana")); 
     285        } 
     286        [Test] 
     287        [Category("UI")] 
     288        public void checkErrorLogin() 
     289        { 
     290            IE ie = new IE("http://localhost:3646/pl/Account/LogOn"); 
     291            ie.TextField(Find.ByName("numer_faktury")).TypeText(""); 
     292            ie.TextField(Find.ByName("nip")).TypeText(""); 
     293            ie.Button(Find.ById("but")).Click(); 
     294 
     295            Assert.IsTrue(ie.ContainsText("Logowanie nie powiodło się")); 
     296        } 
     297       
    83298    } 
    84299} 
  • trunk/eCard/eCardMVC/Platnosci/Controllers/AccountController.cs

    r870 r871  
    6666            { 
    6767                var Login = _repository.FindInvoiceByNipNumber(nip, numer_faktury).SingleOrDefault(); 
    68                     //_context.FindInvoiceByNipNumber(nip, numer_faktury).SingleOrDefault(); 
    6968                platnosc = Login; 
    7069                if (platnosc == null) return View(); 
     
    7877            else 
    7978            { 
     79               _func.SetUserLogger(nip, numer_faktury); 
    8080               return RedirectToAction("Show", "Platnosc", new { id = platnosc.ID_faktury}); 
    8181            } 
  • trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs

    r870 r871  
    2323        private readonly IDataContext _context1; 
    2424        private readonly IRepository<PotwierdzeniaEcard> _rep; 
    25         private readonly IRep<PotwierdzeniaEcard> _repository; 
     25        private readonly IRepository<PlatnosciEcard> _repPl; 
    2626        private FunkcjePlatnosci _func; 
    27  
     27        private string userIdentity = ""; 
     28        private string weryfikacja = ""; 
     29        private string brakdanych = ""; 
     30        private string zaplacono = ""; 
     31        private string err_imie = ""; 
     32        private string err_nazwisko = ""; 
     33         
     34 
     35        protected override void Initialize(System.Web.Routing.RequestContext requestContext) 
     36        {             
     37            base.Initialize(requestContext); 
     38            userIdentity = HttpContext.User.Identity.Name; 
     39            weryfikacja = HttpContext.GetGlobalResourceObject("tlumaczenia", "weryfikacja").ToString(); 
     40            brakdanych = HttpContext.GetGlobalResourceObject("tlumaczenia", "brakdanych").ToString(); 
     41            zaplacono = HttpContext.GetGlobalResourceObject("tlumaczenia", "zaplacono").ToString(); 
     42            err_imie = HttpContext.GetGlobalResourceObject("tlumaczenia", "err_imieWK").ToString(); 
     43            err_nazwisko = HttpContext.GetGlobalResourceObject("tlumaczenia", "err_nazwiskoWK").ToString();            
     44        }        
    2845 
    2946        public PlatnoscController() 
    3047        { 
    3148            _context = new PlatnosciDataContext(); 
    32             _rep = new Repository<PotwierdzeniaEcard>(new DataContext1());  
     49            _rep = new Repository<PotwierdzeniaEcard>(new DataContext1()); 
     50            _repPl = new Repository<PlatnosciEcard>(new DataContext1()); 
    3351            _func = new FunkcjePlatnosci(); 
     52                       
    3453        } 
    3554        public PlatnoscController(IDataContext datacontext){ 
    3655            _rep = new Repository<PotwierdzeniaEcard>(datacontext); 
     56            _repPl = new Repository<PlatnosciEcard>(datacontext); 
    3757            _context1 = datacontext; 
     58            _func = new FunkcjePlatnosci();             
    3859        } 
    3960        public ActionResult Show(string id, string language) 
     
    4970            { 
    5071            } 
    51             
     72           
    5273            vPlatnosciEcard platnosc = _rep.FindInvoiceById(id1).SingleOrDefault(); 
    53             //sprawdzamy czy numer faktury dotyczy zalogowanego usera 
    5474            ErrorViewData errorViewData = new ErrorViewData(); 
    5575            if (platnosc == null) 
    5676            { 
    57                errorViewData.error = HttpContext.GetGlobalResourceObject("tlumaczenia", "brakdanych").ToString(); 
     77               errorViewData.error = brakdanych; 
    5878               return View("Error1", errorViewData);                 
    5979            } 
    60             else if (!_func.UserIdentity(platnosc, ControllerContext.HttpContext.User.Identity.Name)) 
    61             { 
    62                 errorViewData.error = HttpContext.GetGlobalResourceObject("tlumaczenia", "weryfikacja").ToString(); 
     80            else if (!_func.UserIdentity(platnosc, userIdentity)) 
     81            { 
     82                errorViewData.error = weryfikacja; 
    6383                return View("Error1", errorViewData); 
    6484            } 
     
    6888            { 
    6989                string data_zaplaty = String.Format("{0:dd-MM-yyyy}",tablica_potwierdzenia[0].AUTHTIME); 
    70                 errorViewData.error = String.Format(HttpContext.GetGlobalResourceObject("tlumaczenia", "zaplacono").ToString(), platnosc.Faktura_Numer, data_zaplaty); 
     90                errorViewData.error = String.Format(zaplacono, platnosc.Faktura_Numer, data_zaplaty); 
    7191                return View("Error1", errorViewData); 
    7292            } 
     
    83103        { 
    84104            language = _func.setLanguage(language); 
    85             string userName = ControllerContext.HttpContext.User.Identity.Name; 
    86105            int id1 = 0; 
    87106            try 
     
    94113            vPlatnosciEcard platnosc = _rep.FindInvoiceById(id1).SingleOrDefault(); 
    95114            ErrorViewData errorViewData = new ErrorViewData(); 
     115 
     116            if (!_func.UserIdentity(platnosc, userIdentity)) 
     117            { 
     118                errorViewData.error = weryfikacja; 
     119                return View("Error1", errorViewData); 
     120            } 
    96121            if (platnosc == null) 
    97122            { 
    98                 errorViewData.error = HttpContext.GetGlobalResourceObject("tlumaczenia", "brakdanych").ToString(); 
    99                 return View("Error1", errorViewData); 
    100             } 
    101             else if (!_func.UserIdentity(platnosc, ControllerContext.HttpContext.User.Identity.Name)) 
    102             { 
    103                 errorViewData.error = HttpContext.GetGlobalResourceObject("tlumaczenia", "weryfikacja").ToString(); 
     123                errorViewData.error = brakdanych; 
     124                return View("Error1", errorViewData); 
     125            } 
     126            else if (!_func.UserIdentity(platnosc, userIdentity)) 
     127            { 
     128                errorViewData.error = weryfikacja; 
    104129                return View("Error1", errorViewData);   
    105130            } 
     
    107132            if (String.IsNullOrEmpty(payer.FirstName)) 
    108133            { 
    109                 string err_imieWK = HttpContext.GetGlobalResourceObject("tlumaczenia", "err_imieWK").ToString(); 
    110                 ModelState.AddModelError("Payer.FirstName", err_imieWK); 
     134                ModelState.AddModelError("Payer.FirstName", err_imie); 
    111135            } 
    112136            if (String.IsNullOrEmpty(payer.LastName)) 
    113137            { 
    114                 string err_nazwiskoWK = HttpContext.GetGlobalResourceObject("tlumaczenia", "err_nazwiskoWK").ToString(); 
    115                 ModelState.AddModelError("Payer.LastName", err_nazwiskoWK); 
     138                ModelState.AddModelError("Payer.LastName", err_nazwisko); 
    116139            } 
    117140            if (ModelState.IsValid == false) 
     
    146169                return View("Error1", errorViewData); 
    147170            } 
    148             else if (!_func.UserIdentity(platnosc, ControllerContext.HttpContext.User.Identity.Name)) 
    149             { 
    150                 errorViewData.error = HttpContext.GetGlobalResourceObject("tlumaczenia", "weryfikacja").ToString(); 
     171            else if (!_func.UserIdentity(platnosc, userIdentity)) 
     172            { 
     173                errorViewData.error = weryfikacja; 
    151174                return View("Error1", errorViewData); 
    152175            } 
     
    154177            return View(invoiceDeatailsViewData); 
    155178        } 
     179        public void UpdateStatus(int ordernumber, string validationcode) 
     180        { 
     181 
     182            var platnosc = _repPl.FindOne(i => i.ORDERNUMBER == ordernumber); 
     183            if (platnosc != null && platnosc.Status == true && validationcode == "000") 
     184            { 
     185                platnosc.Status = true; 
     186                platnosc.Status_data = DateTime.Now; 
     187                _repPl.Update(platnosc); 
     188            } 
     189        } 
    156190        public ActionResult Status() 
    157191        { 
     
    160194 
    161195            //TODO: validate the Form 
    162  
    163196            string MERCHANTNUMBER = Request.Form["MERCHANTNUMBER"]; 
    164197            int ORDERNUMBER = Convert.ToInt32(Request.Form["ORDERNUMBER"]); 
     
    214247            return invoiceDeatailsViewData; 
    215248        } 
     249        public void setUserIdentity(string value) 
     250        { 
     251            this.userIdentity = value; 
     252 
     253        } 
     254        public void setWeryfikacja(string value) 
     255        { 
     256            this.weryfikacja = value; 
     257 
     258        } 
     259        public void setBrakDanych(string value) 
     260        { 
     261            this.brakdanych = value; 
     262 
     263        } 
     264        public void setZaplacono(string value) 
     265        { 
     266            this.zaplacono = value; 
     267 
     268        }         
    216269                
    217270    } 
  • trunk/eCard/eCardMVC/Platnosci/Global.asax.cs

    r866 r871  
    1717        public static void RegisterRoutes(RouteCollection routes) 
    1818        { 
     19            routes.IgnoreRoute("elmah.axd"); 
    1920            routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 
    2021 
  • trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs

    r866 r871  
    88using System.Web.Mvc; 
    99using System.Configuration; 
     10using System.Security.Principal; 
    1011 
    1112 
     
    9192            return str; 
    9293        } 
     94        public void SetUserLogger(string nip, string faktura){ 
     95             
     96            string User = nip + "-" + faktura; 
     97            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(User, ""), null); 
     98        } 
    9399         
    94100    } 
  • trunk/eCard/eCardMVC/Platnosci/Views/Account/LogOn.aspx

    r866 r871  
    2424            <tr> 
    2525                <td> 
    26                     <asp:Label ID="info" Text="<%$ Resources:tlumaczenia,info %>" runat="server"></asp:Label> 
     26                    <asp:Label ID="info" Text="<%$Resources:tlumaczenia,info %>" runat="server"></asp:Label> 
    2727                    <br /><br />  
    2828                </td> 
    2929            </tr>                         
    3030            <tr> 
    31                 <td class="label_w"><asp:Label ID="nip" Text="<%$ Resources:tlumaczenia,Nip %>" runat="server"></asp:Label></td> 
     31                <td class="label_w"><asp:Label ID="nip" Text="<%$Resources:tlumaczenia,Nip %>" runat="server"></asp:Label></td> 
    3232            </tr> 
    3333            <tr>     
    3434                <td> 
    3535                    <%= Html.TextBox("nip")%> 
    36                     <%= Html.ValidationMessage("nip")%> 
     36                    <%= Html.ValidationMessage("nip","*")%> 
    3737                </td> 
    3838            </tr> 
    3939            <tr> 
    40                 <td class="label_w"><asp:Label ID="numerfaktury" Text="<%$ Resources:tlumaczenia,NumerFaktury %>" runat="server"></asp:Label></td> 
     40                <td class="label_w"><asp:Label ID="numerfaktury" Text="<%$Resources:tlumaczenia,NumerFaktury %>" runat="server"></asp:Label></td> 
    4141            </tr> 
    4242            <tr>     
    4343                <td> 
    4444                    <%= Html.TextBox("numer_faktury")%> 
    45                     <%= Html.ValidationMessage("numer_faktury")%> 
     45                    <%= Html.ValidationMessage("numer_faktury","*")%> 
    4646                </td> 
    4747            </tr> 
     
    4949                <td> 
    5050                    <br /> 
    51                     <input id="but" type="submit" value="<%$Resources:tlumaczenia,Zaloguj%>" runat="server"></input> 
     51                    <input id="but" name="id" type="submit" value="<%=HttpContext.GetGlobalResourceObject("tlumaczenia","Zaloguj").ToString()%>"/> 
    5252                </td> 
    5353            </tr>                                 
  • trunk/eCard/eCardMVC/Platnosci/Web.config

    r867 r871  
    2424                        </sectionGroup> 
    2525                </sectionGroup> 
    26         </configSections> 
     26    <sectionGroup name="elmah"> 
     27      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /> 
     28      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" /> 
     29      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" /> 
     30      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" /> 
     31    </sectionGroup> 
     32  </configSections> 
    2733  <appSettings> 
    2834    <add key="StatusLink" value="http://pay.truck-expo.com/info.aspx"/> 
    2935    <add key="Css" value="truck"/> 
    3036    <add key="StatusLink" value="http://platnosci.admoto.pl/info.aspx"/> 
    31     <add key="Css" value="admoto"/> 
    32      
     37    <add key="Css" value="admoto"/>     
    3338  </appSettings> 
    34         <connectionStrings> 
     39  <elmah> 
     40    <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" /> 
     41    <security allowRemoteAccess="0" /> 
     42  </elmah> 
     43  <!-- 
     44  <location path="elmah.axd"> 
     45    <system.web> 
     46      <authorization> 
     47        <deny users="?" /> 
     48      </authorization> 
     49    </system.web> 
     50  </location> 
     51  --> 
     52  <connectionStrings> 
    3553                <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> 
    3654    <add name="Platnosci.Core.Properties.Settings.BAZA_REKLAM_TESTConnectionString" connectionString="Data Source=sql.ct.com.pl;Initial Catalog=BAZA_REKLAM_TEST;Persist Security Info=True;User ID=wwwadmin;Password=adm1648" providerName="System.Data.SqlClient"/> 
     
    115133                        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> 
    116134                        <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    117                 </httpHandlers> 
     135      <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> 
     136    </httpHandlers> 
    118137                <httpModules> 
    119138                        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    120139                        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    121                 </httpModules> 
     140      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> 
     141    </httpModules> 
    122142        </system.web> 
    123143        <system.codedom>