Beispiel #1
0
        public ActionResult OCRService(pOCRGetConfigurationResult ocrSettings, bool ocrEnabled)
        {
            TimeSpan sh;

            if (ocrSettings.OCRStartHour.Length != 5 || ocrSettings.OCRStartHour.IndexOf(':') != 2 || !TimeSpan.TryParse(ocrSettings.OCRStartHour, out sh))
            {
                ModelState.AddModelError("OCRStartHour", "godzina musi byæ w formacie gg:mm !");
                TempData["entity"] = ocrSettings;
            }
            if (ocrSettings.OCREndHour.Length != 5 || ocrSettings.OCREndHour.IndexOf(':') != 2 || !TimeSpan.TryParse(ocrSettings.OCREndHour, out sh))
            {
                ModelState.AddModelError("OCREndHour", "godzina musi byæ w formacie gg:mm !");
                TempData["entity"] = ocrSettings;
            }

            if (ModelState.IsValid)
            {
                _repository.SaveOCRConfiguration(ocrSettings.OCRStartHour, ocrSettings.OCREndHour, ocrEnabled);
                return(RedirectToAction("OCRService"));
            }
            return(View(ocrSettings));
        }