public ActionResult Result()
        {
            string decoded = DecodeCapturedPhoto();

            if (decoded == "")
            {
                return(View("Error"));
            }

            BarCode barcode = BarCode.GetData(decoded);

            if (!barcode.valid)
            {
                ViewBag.QrResult = barcode.code + " are un format invalid";
            }
            else
            if (!CheckIfRecordExists(barcode.code, barcode.quantity))
            {
                ViewBag.QrResult = barcode.code + " nu a putut fi gasit in baza de date";
            }
            else
            if (!DeleteEntry(barcode.code, barcode.quantity))
            {
                ViewBag.QrResult = barcode.code + " nu a putut fi sters din baza de date";
            }
            else
            {
                ViewBag.QrResult = barcode.code + " " + barcode.quantity + " a fost sters din baza de date";
            }

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Index(string barcode)
        {
            BarCode codeData = BarCode.GetData(barcode);

            if (!codeData.valid || codeData.quantity <= 0)
            {
                return(View("Error"));
            }

            if (!SqlValid(codeData))
            {
                return(View("Error"));
            }
            Encode(codeData);
            DecodeGeneratedCodes();

            return(View());
        }