Beispiel #1
0
        public static object Modificar_Categorias_Productos(SPC_GET_CATEGORIA_Result record)
        {
            try
            {
                using (var DB = new TPVDBEntities())
                {
                    int?codigo_categoria_padre = null;
                    if (record.Codigo_Categoria_Padre_Producto != 0)
                    {
                        codigo_categoria_padre = record.Codigo_Categoria_Padre_Producto;
                    }

                    DB.SPC_SET_CATEGORIA(
                        record.Codigo_Categoria_Producto,
                        codigo_categoria_padre,
                        record.Categoria_Producto,
                        record.Orden,
                        true);
                }
                return(new { Result = "OK", Record = record });
            }
            catch
            {
                return(new { Result = "ERROR", Message = "Ocurrió un inconveniente al momento de actualizar la categoría." });
            }
        }