Pokaż
Ignoruj:
Data:
2009-11-10 16:01:21 (16 years ago)
Autor:
alina
Opis:

re #215

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs

    r871 r872  
    2525        private readonly IRepository<PlatnosciEcard> _repPl; 
    2626        private FunkcjePlatnosci _func; 
    27         private string userIdentity = ""; 
    2827        private string weryfikacja = ""; 
    2928        private string brakdanych = ""; 
     
    3130        private string err_imie = ""; 
    3231        private string err_nazwisko = ""; 
    33          
    3432 
    3533        protected override void Initialize(System.Web.Routing.RequestContext requestContext) 
    3634        {             
    3735            base.Initialize(requestContext); 
    38             userIdentity = HttpContext.User.Identity.Name; 
    3936            weryfikacja = HttpContext.GetGlobalResourceObject("tlumaczenia", "weryfikacja").ToString(); 
    4037            brakdanych = HttpContext.GetGlobalResourceObject("tlumaczenia", "brakdanych").ToString(); 
     
    5249                       
    5350        } 
    54         public PlatnoscController(IDataContext datacontext){ 
     51        public PlatnoscController(IDataContext datacontext) 
     52        { 
    5553            _rep = new Repository<PotwierdzeniaEcard>(datacontext); 
    5654            _repPl = new Repository<PlatnosciEcard>(datacontext); 
    5755            _context1 = datacontext; 
    58             _func = new FunkcjePlatnosci();             
     56            _func = new FunkcjePlatnosci(); 
    5957        } 
    6058        public ActionResult Show(string id, string language) 
    6159        { 
     60           
    6261            language = _func.setLanguage(language); 
    63             string jezyk = Thread.CurrentThread.CurrentCulture.Name.ToString(); 
    6462            int id1 = 0; 
    6563            try 
     
    6967            catch 
    7068            { 
    71             } 
    72            
     69            }           
    7370            vPlatnosciEcard platnosc = _rep.FindInvoiceById(id1).SingleOrDefault(); 
    7471            ErrorViewData errorViewData = new ErrorViewData(); 
     
    7875               return View("Error1", errorViewData);                 
    7976            } 
    80             else if (!_func.UserIdentity(platnosc, userIdentity)) 
     77            else if (!_func.UserIdentity(platnosc, HttpContext.User.Identity.Name)) 
    8178            { 
    8279                errorViewData.error = weryfikacja; 
     
    9087                errorViewData.error = String.Format(zaplacono, platnosc.Faktura_Numer, data_zaplaty); 
    9188                return View("Error1", errorViewData); 
    92             } 
    93              
     89            }             
    9490            string kwota = ""; 
    9591            kwota = _func.BruttoToString(platnosc.Brutto, platnosc.waluta_brutto, platnosc.waluta_miano); 
     
    114110            ErrorViewData errorViewData = new ErrorViewData(); 
    115111 
    116             if (!_func.UserIdentity(platnosc, userIdentity)) 
     112            if (!_func.UserIdentity(platnosc, HttpContext.User.Identity.Name)) 
    117113            { 
    118114                errorViewData.error = weryfikacja; 
     
    124120                return View("Error1", errorViewData); 
    125121            } 
    126             else if (!_func.UserIdentity(platnosc, userIdentity)) 
     122            else if (!_func.UserIdentity(platnosc, HttpContext.User.Identity.Name)) 
    127123            { 
    128124                errorViewData.error = weryfikacja; 
     
    166162            if (platnosc == null) 
    167163            { 
    168                 errorViewData.error = HttpContext.GetGlobalResourceObject("tlumaczenia", "faktura_error").ToString(); 
    169                 return View("Error1", errorViewData); 
    170             } 
    171             else if (!_func.UserIdentity(platnosc, userIdentity)) 
     164                errorViewData.error = brakdanych; 
     165                return View("Error1", errorViewData); 
     166            } 
     167            else if (!_func.UserIdentity(platnosc, HttpContext.User.Identity.Name)) 
    172168            { 
    173169                errorViewData.error = weryfikacja; 
     
    247243            return invoiceDeatailsViewData; 
    248244        } 
    249         public void setUserIdentity(string value) 
    250         { 
    251             this.userIdentity = value; 
    252  
    253         } 
    254245        public void setWeryfikacja(string value) 
    255246        {