Exemple #1
0
        public MethodResponse <string> PostProduct(object infoProduct)
        {
            var response = new MethodResponse <string>();

            try
            {
                var logic = new LogicEngine();
                var res   = logic.InsProduct(infoProduct);

                if (int.Parse(res.Code.ToString()) != 0)
                {
                    return(new MethodResponse <string>()
                    {
                        Code = res.Code, Message = res.Message
                    });
                }
                response = res;

                return(response);
            }
            catch (Exception ex)
            {
                return(new MethodResponse <string>()
                {
                    Code = -1, Message = "Ocurrio un error al insertar los productos: " + ex.Message
                });
            }
        }