public async Task <ActionResult> ConfermaProv([FromBody] JObject data)
        {
            var part   = data["PartID"].ToObject <string>();
            var serial = data["SerialID"].ToObject <string>();

            if (checkPartSerial(part, serial))
            {
                Strumento str = new Strumento();
                str.PartId      = part;
                str.SerialId    = serial;
                str.Nome        = data["Nome"].ToObject <string>();
                str.Marca       = data["Marca"].ToObject <string>();
                str.Modello     = data["Modello"].ToObject <string>();
                str.Descrizione = data["Descrizione"].ToObject <string>();
                str.Posizione   = data["Posizione"].ToObject <string>();;
                str.Status      = data["Status"].ToObject <int>();
                str.TTL         = data["TTL"].ToObject <DateTime>();
                _context.Strumento.Add(str);
                await _context.SaveChangesAsync();

                StrumentoProvvisorio strProv = _context.StrumentoProvvisorio.Find(data["Id"].ToObject <string>());
                _context.StrumentoProvvisorio.Remove(strProv);
                await _context.SaveChangesAsync();

                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
        public async Task <ActionResult> PostStrumentoProvvisorio([FromBody] JObject data)
        {
            var desc      = data["Descrizione"].ToObject <string>();
            var strumento = data["Strumento"].ToObject <Strumento>();

            strumento.Status      = 1;
            strumento.Descrizione = desc;
            var s = new StrumentoProvvisorio();

            s.PartId      = strumento.PartId;
            s.SerialId    = strumento.SerialId;
            s.Descrizione = strumento.Descrizione;
            s.Status      = strumento.Status;
            s.Nome        = strumento.Nome;
            s.Marca       = strumento.Marca;
            s.Modello     = strumento.Modello;
            s.Posizione   = strumento.Posizione;
            s.TTL         = strumento.TTL;
            s.Delicato    = strumento.Delicato;
            if (strumento.PDFPath != null)
            {
                s.PDFPath = strumento.PDFPath;
            }
            if (strumento.ImgPath != null)
            {
                s.ImgPath = strumento.ImgPath;
            }
            _context.StrumentoProvvisorio.Add(s);
            await _context.SaveChangesAsync();

            return(Ok());
        }