public ActionResult Upload(int id, string mode)
        {
            ViewBag.OsobaId = id;
            ViewBag.mode    = mode;
            PhotoProp model = new PhotoProp();
            var       imgid = 0;
            var       sam   = osobaRepository.GetOsobaById(id);

            //var samimg = imageSamochodRepository.GetPhotoPropsForSamochodId(id).Count()+1;
            switch (mode)
            {
            case "1":
                imgid = imageDowodOsobistyRepository.FindAllImagesForOsobaId(id).Count() + 1;
                model.AlternateText = "Dowod osobisty " + sam.Imie + " " + sam.Nazwisko + " " + imgid;
                model.Name          = sam.OsobaId + "_DowodOsobisty_" + imgid;
                break;

            case "2":
                imgid = imagePaszportRepository.FindAllImagesForOsobaId(id).Count() + 1;
                model.AlternateText = "Paszport " + sam.Imie + " " + sam.Nazwisko + " " + imgid;
                model.Name          = sam.OsobaId + "_paszport_" + imgid;
                break;

            default:
                break;
            }


            return(PartialView("Upload", model));
        }
Beispiel #2
0
        public ActionResult DeleteZdjecie(int id, int ObjId)
        {
            ViewBag.PhotoId = id;
            ViewBag.ObjId   = ObjId;
            PhotoProp photoProp = new PhotoProp();

            return(PartialView("_DeleteZdjecie"));
        }
Beispiel #3
0
        public ActionResult Upload(int id)
        {
            ViewBag.SamochodId = id;
            var       sam    = samochodRepository.GetSamochodById(id);
            var       samimg = imageSamochodRepository.GetPhotoPropsForSamochodId(id).Count() + 1;
            PhotoProp model  = new PhotoProp();

            model.AlternateText = sam.Marka + " " + sam.Model + " " + sam.PojemnoscSilnika + " " + sam.Kolor + " " + sam.RokProdukcji.Year + " " + samimg;
            model.Name          = sam.Marka + " " + sam.Model + " " + samimg;
            return(PartialView("Upload", model));
        }
Beispiel #4
0
    void Update()
    {
        if (_doGrab)
        {
            RenderTexture.active = renderTexture;

            // Take snap
            _lastSnap = new Texture2D(256, 256);
            _lastSnap.ReadPixels(new Rect(0, 0, 256, 256), 0, 0);
            _lastSnap.Apply();

            // Create prefab
            StaticImage si = Instantiate(photoPrefab, photoParent, false).GetComponent <StaticImage>();
            si.Initialize(_lastSnap);

            //_lastSnap.Resize(10, 10);
            Sprite    s  = Sprite.Create(_lastSnap, new Rect(0, 0, 256, 256), new Vector2(0.5f, 0.5f), 256);
            PhotoProp pp = Instantiate(photoPropPrefab, (Vector2)photoPropOrigin.position, Quaternion.identity, null).GetComponent <PhotoProp>();
            pp.Initialize(s);

            _doGrab = false;
        }
    }