Zbiór zmian 989 dla trunk

Pokaż
Ignoruj:
Data:
2010-01-04 09:47:00 (16 years ago)
Autor:
marek
Opis:

re #215

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/adMoto.Payments.Web/Controllers/eCardController.cs

    r985 r989  
    66using adMoto.Payments.Web.Exceptions; 
    77using Elmah; 
    8 using System.Collections.Generic; 
    9  
    10 using System.Configuration; 
    11 using System.Linq; 
    128 
    139namespace adMoto.Payments.Web.Controllers 
     
    3733                if (System.Web.HttpContext.Current != null) 
    3834                    ErrorSignal.FromCurrentContext().Raise(new ConfirmationLogger(), System.Web.HttpContext.Current); 
    39                  
     35 
    4036                var potwierdzenie = new PotwierdzeniaEcard(); 
    41                  
    4237                potwierdzenie.MERCHANTNUMBER = Request["MERCHANTNUMBER"] ?? Request.Form["MERCHANTNUMBER"]; 
    43                 if (String.IsNullOrEmpty(potwierdzenie.MERCHANTNUMBER)) 
    44                     throw new ArgumentNullException("MERCHANTNUMBER"); 
    45  
    46                 string ordernumber = Request["ORDERNUMBER"] ?? Request.Form["ORDERNUMBER"]; 
    47                 if (!String.IsNullOrEmpty(ordernumber)) 
    48                     potwierdzenie.ORDERNUMBER = Convert.ToInt32(ordernumber); 
    49                 else 
    50                     throw new ArgumentNullException("ORDERNUMBER"); 
    51  
     38                potwierdzenie.ORDERNUMBER = Request["ORDERNUMBER"] != null ? Convert.ToInt32(Request["ORDERNUMBER"]) : Convert.ToInt32(Request.Form["ORDERNUMBER"]); 
    5239                potwierdzenie.COMMTYPE = Request["COMMTYPE"] ?? Request.Form["COMMTYPE"]; 
    53                 if (String.IsNullOrEmpty(potwierdzenie.COMMTYPE)) 
    54                     throw new ArgumentNullException("COMMTYPE"); 
    55  
    5640                potwierdzenie.CURRENTSTATE = Request["CURRENTSTATE"] ?? Request.Form["CURRENTSTATE"]; 
    57                 if (String.IsNullOrEmpty(potwierdzenie.CURRENTSTATE)) 
    58                     throw new ArgumentNullException("CURRENTSTATE"); 
    59  
    6041                potwierdzenie.PREVIOUSSTATE = Request["PREVIOUSSTATE"] ?? Request.Form["PREVIOUSSTATE"]; 
    61                 if (String.IsNullOrEmpty(potwierdzenie.PREVIOUSSTATE)) 
    62                     throw new ArgumentNullException("PREVIOUSSTATE"); 
    63  
    64                 string paymenttype = Request["PAYMENTTYPE"] ?? Request.Form["PAYMENTTYPE"]; 
    65                 if (!String.IsNullOrEmpty(paymenttype)) 
    66                     potwierdzenie.PAYMENTTYPE = Convert.ToBoolean(paymenttype); 
    67                 else 
    68                     throw new ArgumentNullException("PAYMENTTYPE"); 
    69  
    70                 string eventtype = Request["EVENTTYPE"] ?? Request.Form["EVENTTYPE"]; 
    71                 if (!String.IsNullOrEmpty(eventtype)) 
    72                     potwierdzenie.EVENTTYPE = Convert.ToBoolean(eventtype); 
    73                 else 
    74                     throw new ArgumentNullException("EVENTTYPE"); 
    75  
    76                 string paymentnumber = Request["PAYMENTNUMBER"] ?? Request.Form["PAYMENTNUMBER"]; 
    77                 if (!String.IsNullOrEmpty(paymentnumber)) 
    78                     potwierdzenie.PAYMENTNUMBER = Convert.ToBoolean(paymentnumber); 
    79                 else 
    80                     throw new ArgumentNullException("PAYMENTNUMBER"); 
    81                 
     42                potwierdzenie.PAYMENTTYPE = Request["PAYMENTTYPE"] != null ? Convert.ToBoolean(Convert.ToInt32(Request["PAYMENTTYPE"])) : Convert.ToBoolean(Convert.ToInt32(Request.Form["PAYMENTTYPE"])); 
     43                potwierdzenie.EVENTTYPE = Request["EVENTTYPE"] != null ? Convert.ToBoolean(Convert.ToInt32(Request["EVENTTYPE"])) : Convert.ToBoolean(Convert.ToInt32(Request.Form["EVENTTYPE"])); 
     44                potwierdzenie.PAYMENTNUMBER = Request["PAYMENTNUMBER"] != null ? Convert.ToBoolean(Convert.ToInt32(Request["PAYMENTNUMBER"])) : Convert.ToBoolean(Convert.ToInt32(Request.Form["PAYMENTNUMBER"])); 
     45                potwierdzenie.APPROVALCODE = Request["APPROVALCODE"] ?? Request.Form["APPROVALCODE"]; 
    8246                potwierdzenie.VALIDATIONCODE = Request["VALIDATIONCODE"] ?? Request.Form["VALIDATIONCODE"]; 
    83                 if (String.IsNullOrEmpty(potwierdzenie.VALIDATIONCODE)) 
    84                     throw new ArgumentNullException("VALIDATIONCODE"); 
    85  
    86                 //zapisywany do bazy tylko wtedy, gdy validationcode = 000 
    87                 potwierdzenie.APPROVALCODE = Request["APPROVALCODE"] ?? Request.Form["APPROVALCODE"]; 
    88                 if (String.IsNullOrEmpty(potwierdzenie.APPROVALCODE) && potwierdzenie.VALIDATIONCODE == "000") 
    89                     throw new ArgumentNullException("APPROVALCODE"); 
    90  
    9147                potwierdzenie.BIN = Request["BIN"] ?? Request.Form["BIN"]; 
    92                 if (String.IsNullOrEmpty(potwierdzenie.BIN)) 
    93                     throw new ArgumentNullException("BIN"); 
    94                      
    95                 string authtime = Request["AUTHTIME"] ?? Request.Form["AUTHTIME"]; 
    96                 if (!String.IsNullOrEmpty(authtime)) 
    97                     potwierdzenie.AUTHTIME = Convert.ToDateTime(authtime); 
    98                 else 
    99                     throw new ArgumentNullException("AUTHTIME"); 
    100                 
     48                potwierdzenie.AUTHTIME = Request["AUTHTIME"] != null ? Convert.ToDateTime(Request["AUTHTIME"]) : Convert.ToDateTime(Request.Form["AUTHTIME"]); 
    10149                potwierdzenie.TYPE = Request["TYPE"] ?? Request.Form["TYPE"]; 
    102                 if (String.IsNullOrEmpty(potwierdzenie.TYPE)) 
    103                     throw new ArgumentNullException("TYPE"); 
    104  
    10550                potwierdzenie.WITHCVC = Request["WITHCVC"] ?? Request.Form["WITHCVC"]; 
    106                 if (String.IsNullOrEmpty(potwierdzenie.WITHCVC)) 
    107                     throw new ArgumentNullException("WITHCVC");       
    108                 
    109                 potwierdzenie.DATATRANSMISJI = DateTime.Now;  
     51                potwierdzenie.DATATRANSMISJI = DateTime.Now; 
    11052 
    11153                _eCardRepository.Insert(potwierdzenie); 
     
    12163 
    12264            return content; 
    123         }        
     65        } 
    12466    } 
    12567}