Пример #1
0
        public ActionResult <IEnumerable <string> > postStore([FromForm] Comp_Store store)
        {
            EncriptarSDES.StartKey();
            if (store._name != null && store._address != null)
            {
                BTree <Comp_Store> .Create(treeFile, new ToObject(Comp_Store.ConvertToObject), new ToString(Comp_Store.ConvertToString));

                BTree <Comp_Store> .ValidateIncert(new Comp_Store { _id = BTree <Comp_Store> .KnowId(), _name = store._name, _address = store._address });
            }
            else
            {
                return(BadRequest("Solicitud erronea."));
            }
            return(Ok("Datos ingresados correctamente."));
        }
Пример #2
0
        public ActionResult <IEnumerable <string> > putProduct([FromForm] Comp_Store store)
        {
            EncriptarSDES.StartKey();
            BTree <Comp_Store> .Create(treeFile, new ToObject(Comp_Store.ConvertToObject), new ToString(Comp_Store.ConvertToString));

            if (BTree <Comp_Store> .Traversal(new Comp_Store {
                _id = store._id
            }, 1).Count == 0)
            {
                return(NotFound("El ID no se encontró."));
            }

            BTree <Comp_Store> .ValidateEdit(store, new string[2] {
                store._name, store._address
            }, new Edit(Comp_Store.Modify));

            return(Ok("El id: " + store._id + " fue actualizado."));
        }